All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs(), v3
@ 2009-01-15 20:02 Coly Li
  0 siblings, 0 replies; only message in thread
From: Coly Li @ 2009-01-15 20:02 UTC (permalink / raw)
  To: ocfs2-devel

Currently f_fsid of struct kstatfs returned from ocfs2_statfs() is undefined (vfs layer fills 0 as
default). Since in some conditions, f_fsid value might be used as (f_fsid, ino) pair to
uniquely identify a file, ocfs2 should return a unique defined f_fsid value from ocfs2_statfs().

This patch uses uuid_hash as a unique ID to initiate f_fsid value. The 32bits width is enough for
ocfs2 membership so far.

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Sunil Mushran <sunil.mushran@oracle.com>
---
  fs/ocfs2/super.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 43ed113..db837ee 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1425,6 +1425,8 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
 	buf->f_bavail = buf->f_bfree;
 	buf->f_files = numbits;
 	buf->f_ffree = freebits;
+	buf->f_fsid.val[0] = osb->uuid_hash & 0xFFFFFFFFUL;
+	buf->f_fsid.val[1] = (osb->uuid_hash >> 32) & 0xFFFFFFFFUL;

 	brelse(bh);

-- 
Coly Li
SuSE Labs

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-15 20:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-15 20:02 [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs(), v3 Coly Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.