From 07c3f0138f327fe86c400aa51679342eaaf1a5c7 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 12 Sep 2008 12:46:43 -0700 Subject: [PATCH] kclient: fill in kstatfs f_fsid --- src/TODO | 4 ---- src/kernel/super.c | 7 ++++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/TODO b/src/TODO index f18bf553cb2e7..dd8d1248751ed 100644 --- a/src/TODO +++ b/src/TODO @@ -52,12 +52,8 @@ userspace client - fix readdir vs fragment race by keeping a separate frag pos, and ignoring dentries below it kernel client -- statfs fsid should xor the ceph_fsid hi/low words - async writepages? - we want to saturate network with writeback on a single file -- add i_frag_mutex to protect the frag tree.. - - get rid of ugly i_lock vs kmalloc juggling in get_or_create_frag -- fsync on dir? what is that supposed to do? - make writepages maybe skip pages with errors? - EIO, or ENOSPC? - ... writeback vs ENOSPC vs flush vs close()... hrm... diff --git a/src/kernel/super.c b/src/kernel/super.c index eb5ba2873da89..598dd24b7144c 100644 --- a/src/kernel/super.c +++ b/src/kernel/super.c @@ -76,7 +76,9 @@ static void ceph_put_super(struct super_block *s) static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf) { struct ceph_client *client = ceph_inode_to_client(dentry->d_inode); + struct ceph_monmap *monmap = client->monc.monmap; struct ceph_statfs st; + __le64 fsid; int err; dout(30, "ceph_statfs\n"); @@ -92,10 +94,13 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf) buf->f_bavail = st.f_avail >> (CEPH_BLOCK_SHIFT-10); buf->f_files = st.f_objects; buf->f_ffree = -1; - /* fsid? */ buf->f_namelen = PATH_MAX; buf->f_frsize = 4096; + fsid = monmap->fsid.major ^ monmap->fsid.minor; + buf->f_fsid.val[0] = fsid & 0xffffffff; + buf->f_fsid.val[1] = fsid >> 32; + return 0; } -- 2.39.5