diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2008-08-18 07:01:52 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:06 -0400 |
commit | 9d03632e26e1a0a9e4a632cf426a7c0566768a7d (patch) | |
tree | e539a220e6e824f14ca84ea8635051ade4932669 /fs/btrfs/super.c | |
parent | f2322b1c652add8bcd64b10843d76b0211ab1fc6 (diff) |
Fill f_fsid field in btrfs_statfs()
Date: Mon, 18 Aug 2008 12:01:52 +0100
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 | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index e830e0ed409a..6446ab73f35a 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -489,6 +489,7 @@ static int btrfs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
489 | struct btrfs_root *root = btrfs_sb(dentry->d_sb); | 489 | struct btrfs_root *root = btrfs_sb(dentry->d_sb); |
490 | struct btrfs_super_block *disk_super = &root->fs_info->super_copy; | 490 | struct btrfs_super_block *disk_super = &root->fs_info->super_copy; |
491 | int bits = dentry->d_sb->s_blocksize_bits; | 491 | int bits = dentry->d_sb->s_blocksize_bits; |
492 | __be32 *fsid = (__be32 *)root->fs_info->fsid; | ||
492 | 493 | ||
493 | buf->f_namelen = BTRFS_NAME_LEN; | 494 | buf->f_namelen = BTRFS_NAME_LEN; |
494 | buf->f_blocks = btrfs_super_total_bytes(disk_super) >> bits; | 495 | buf->f_blocks = btrfs_super_total_bytes(disk_super) >> bits; |
@@ -497,6 +498,11 @@ static int btrfs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
497 | buf->f_bavail = buf->f_bfree; | 498 | buf->f_bavail = buf->f_bfree; |
498 | buf->f_bsize = dentry->d_sb->s_blocksize; | 499 | buf->f_bsize = dentry->d_sb->s_blocksize; |
499 | buf->f_type = BTRFS_SUPER_MAGIC; | 500 | buf->f_type = BTRFS_SUPER_MAGIC; |
501 | /* We treat it as constant endianness (it doesn't matter _which_) | ||
502 | because we want the fsid to come out the same whether mounted | ||
503 | on a big-endian or little-endian host */ | ||
504 | buf->f_fsid.val[0] = be32_to_cpu(fsid[0]) ^ be32_to_cpu(fsid[2]); | ||
505 | buf->f_fsid.val[1] = be32_to_cpu(fsid[1]) ^ be32_to_cpu(fsid[3]); | ||
500 | return 0; | 506 | return 0; |
501 | } | 507 | } |
502 | 508 | ||