diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2008-08-18 14:10:20 +0200 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 17:04:06 +0200 |
commit | 32d48fa1af1fe066a6a4798e6f5a50ac6a3ce4a3 (patch) | |
tree | 4af69093c91b08d05876762129157f99011aee0f /fs/btrfs/super.c | |
parent | Fill f_fsid field in btrfs_statfs() (diff) | |
download | linux-32d48fa1af1fe066a6a4798e6f5a50ac6a3ce4a3.tar.xz linux-32d48fa1af1fe066a6a4798e6f5a50ac6a3ce4a3.zip |
Mask root object ID into f_fsid in btrfs_statfs()
Date: Mon, 18 Aug 2008 13:10:20 +0100
This means that subvolumes get a different fsid, and NFS exporting them
works properly.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 6446ab73f35a..55f4d00fda3a 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -503,6 +503,10 @@ static int btrfs_statfs(struct dentry *dentry, struct kstatfs *buf) on a big-endian or little-endian host */ buf->f_fsid.val[0] = be32_to_cpu(fsid[0]) ^ be32_to_cpu(fsid[2]); buf->f_fsid.val[1] = be32_to_cpu(fsid[1]) ^ be32_to_cpu(fsid[3]); + /* Mask in the root object ID too, to disambiguate subvols */ + buf->f_fsid.val[0] ^= BTRFS_I(dentry->d_inode)->root->objectid >> 32; + buf->f_fsid.val[1] ^= BTRFS_I(dentry->d_inode)->root->objectid; + return 0; } |