aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorColy Li <coly.li@suse.de>2009-01-16 03:33:05 -0500
committerJoel Becker <joel.becker@oracle.com>2009-10-29 18:02:20 -0400
commit837711f862bb71ac263837a0f0714dd8cc4ef7ea (patch)
tree888b92d23a7563ef1d5a866ac46f2d48a8564101 /fs
parent2f48d593b6ceb7bb63d34124ceba77d33be298cf (diff)
ocfs2: return f_fsid info in ocfs2_statfs()
Currently the f_fsid of struct kstatfs returned from ocfs2_statfs() is undefined (vfs layer fills in 0 as default). Since in some conditions, f_fsid value might be used in a (f_fsid, ino) pair to uniquely identify a file, ocfs2 should return a unique defined f_fsid value from ocfs2_statfs(). Because uuid_str is the same on big or litlle endian machine, it's endian consistent to use osb->uuid_str to generate f_fsid value. Signed-off-by: Coly Li <coly.li@suse.de> Cc: Sunil Mushran <sunil.mushran@oracle.com> Cc: Mark Fasheh <mfasheh@suse.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/super.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 960673004df1..14f47d2bfe02 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1647,6 +1647,10 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
1647 buf->f_bavail = buf->f_bfree; 1647 buf->f_bavail = buf->f_bfree;
1648 buf->f_files = numbits; 1648 buf->f_files = numbits;
1649 buf->f_ffree = freebits; 1649 buf->f_ffree = freebits;
1650 buf->f_fsid.val[0] = crc32_le(0, osb->uuid_str, OCFS2_VOL_UUID_LEN)
1651 & 0xFFFFFFFFUL;
1652 buf->f_fsid.val[1] = crc32_le(0, osb->uuid_str + OCFS2_VOL_UUID_LEN,
1653 OCFS2_VOL_UUID_LEN) & 0xFFFFFFFFUL;
1650 1654
1651 brelse(bh); 1655 brelse(bh);
1652 1656