From: David Howells Subject: [PATCH 11/30] NFS: Use the dentry superblock directly in nfs_statfs() [try #11] Date: Thu, 27 Jul 2006 21:52:50 +0100 Message-ID: <20060727205250.8443.5984.stgit@warthog.cambridge.redhat.com> References: <20060727205222.8443.29381.stgit@warthog.cambridge.redhat.com> Reply-To: Linux filesystem caching discussion list Content-Type: text/plain; charset=utf-8; format=fixed Content-Transfer-Encoding: quoted-printable Cc: linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com, nfsv4@linux-nfs.org, linux-kernel@vger.kernel.org Return-path: To: torvalds@osdl.org, akpm@osdl.org, steved@redhat.com, trond.myklebust@fys.uio.no In-Reply-To: <20060727205222.8443.29381.stgit@warthog.cambridge.redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cachefs-bounces@redhat.com Errors-To: linux-cachefs-bounces@redhat.com List-Id: linux-fsdevel.vger.kernel.org Use the nominated dentry's superblock directly in the NFS statfs() op to = get a file handle, rather than using s_root (which will become a dummy dentry i= n a future patch). Signed-Off-By: David Howells Signed-off-by: Trond Myklebust --- fs/nfs/super.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index ce24b52..4e128fe 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -235,11 +235,10 @@ #endif */ static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf) { - struct super_block *sb =3D dentry->d_sb; - struct nfs_server *server =3D NFS_SB(sb); + struct nfs_server *server =3D NFS_SB(dentry->d_sb); unsigned char blockbits; unsigned long blockres; - struct nfs_fh *rootfh =3D NFS_FH(sb->s_root->d_inode); + struct nfs_fh *fh =3D NFS_FH(dentry->d_inode); struct nfs_fattr fattr; struct nfs_fsstat res =3D { .fattr =3D &fattr, @@ -248,7 +247,7 @@ static int nfs_statfs(struct dentry *den =20 lock_kernel(); =20 - error =3D server->rpc_ops->statfs(server, rootfh, &res); + error =3D server->rpc_ops->statfs(server, fh, &res); buf->f_type =3D NFS_SUPER_MAGIC; if (error < 0) goto out_err; @@ -258,7 +257,7 @@ static int nfs_statfs(struct dentry *den * case where f_frsize !=3D f_bsize. Eventually we want to * report the value of wtmult in this field. */ - buf->f_frsize =3D sb->s_blocksize; + buf->f_frsize =3D dentry->d_sb->s_blocksize; =20 /* * On most *nix systems, f_blocks, f_bfree, and f_bavail @@ -267,8 +266,8 @@ static int nfs_statfs(struct dentry *den * thus historically Linux's sys_statfs reports these * fields in units of f_bsize. */ - buf->f_bsize =3D sb->s_blocksize; - blockbits =3D sb->s_blocksize_bits; + buf->f_bsize =3D dentry->d_sb->s_blocksize; + blockbits =3D dentry->d_sb->s_blocksize_bits; blockres =3D (1 << blockbits) - 1; buf->f_blocks =3D (res.tbytes + blockres) >> blockbits; buf->f_bfree =3D (res.fbytes + blockres) >> blockbits;