From: Pekka Enberg Date: Thu, 7 Dec 2006 04:35:28 +0000 (-0800) Subject: [PATCH] ext3: fsid for statvfs X-Git-Tag: v2.6.20-rc1~15^2~14^2~244 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50ee0a32b192902e32a2b596df7ec3496c4bf485;p=platform%2Fkernel%2Flinux-exynos.git [PATCH] ext3: fsid for statvfs Update ext3_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 Cc: Stephen Tweedie Signed-off-by: Pekka Enberg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 9856565..8ab1981 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -2387,6 +2387,7 @@ static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf) struct ext3_super_block *es = sbi->s_es; ext3_fsblk_t overhead; int i; + u64 fsid; if (test_opt (sb, MINIX_DF)) overhead = 0; @@ -2433,6 +2434,10 @@ static int ext3_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 = EXT3_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; }