summaryrefslogtreecommitdiffstats
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2006-12-06 20:35:29 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 08:39:31 -0800
commit960cc398a7a2acfe455b2ec33c64dc6018c83aab (patch)
tree6110fff705b01b550ac6e7d3d7ac5558caff6124 /fs/ext4/super.c
parent50ee0a32b192902e32a2b596df7ec3496c4bf485 (diff)
[PATCH] ext4: fsid for statvfs
Update ext4_statfs to return an FSID that is a 64 bit XOR of the 128 bit filesystem UUID as suggested by Andreas Dilger. See the following Bugzilla entry for details: http://bugzilla.kernel.org/show_bug.cgi?id=136 Cc: Andreas Dilger <adilger@clusterfs.com> Cc: Stephen Tweedie <sct@redhat.com> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index f2e8c4aa0fd2..2ede7e2c7019 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2460,6 +2460,7 @@ static int ext4_statfs (struct dentry * dentry, struct kstatfs * buf)
struct ext4_super_block *es = sbi->s_es;
ext4_fsblk_t overhead;
int i;
+ u64 fsid;
if (test_opt (sb, MINIX_DF))
overhead = 0;
@@ -2506,6 +2507,10 @@ static int ext4_statfs (struct dentry * dentry, struct kstatfs * buf)
buf->f_files = le32_to_cpu(es->s_inodes_count);
buf->f_ffree = percpu_counter_sum(&sbi->s_freeinodes_counter);
buf->f_namelen = EXT4_NAME_LEN;
+ fsid = le64_to_cpup((void *)es->s_uuid) ^
+ le64_to_cpup((void *)es->s_uuid + sizeof(u64));
+ buf->f_fsid.val[0] = fsid & 0xFFFFFFFFUL;
+ buf->f_fsid.val[1] = (fsid >> 32) & 0xFFFFFFFFUL;
return 0;
}