aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r--fs/nfs/super.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index f97d7d9c5c32..a41d516ed595 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -240,11 +240,10 @@ void __exit unregister_nfs_fs(void)
240 */ 240 */
241static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf) 241static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf)
242{ 242{
243 struct super_block *sb = dentry->d_sb; 243 struct nfs_server *server = NFS_SB(dentry->d_sb);
244 struct nfs_server *server = NFS_SB(sb);
245 unsigned char blockbits; 244 unsigned char blockbits;
246 unsigned long blockres; 245 unsigned long blockres;
247 struct nfs_fh *rootfh = NFS_FH(sb->s_root->d_inode); 246 struct nfs_fh *fh = NFS_FH(dentry->d_inode);
248 struct nfs_fattr fattr; 247 struct nfs_fattr fattr;
249 struct nfs_fsstat res = { 248 struct nfs_fsstat res = {
250 .fattr = &fattr, 249 .fattr = &fattr,
@@ -253,7 +252,7 @@ static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf)
253 252
254 lock_kernel(); 253 lock_kernel();
255 254
256 error = server->rpc_ops->statfs(server, rootfh, &res); 255 error = server->rpc_ops->statfs(server, fh, &res);
257 buf->f_type = NFS_SUPER_MAGIC; 256 buf->f_type = NFS_SUPER_MAGIC;
258 if (error < 0) 257 if (error < 0)
259 goto out_err; 258 goto out_err;
@@ -263,7 +262,7 @@ static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf)
263 * case where f_frsize != f_bsize. Eventually we want to 262 * case where f_frsize != f_bsize. Eventually we want to
264 * report the value of wtmult in this field. 263 * report the value of wtmult in this field.
265 */ 264 */
266 buf->f_frsize = sb->s_blocksize; 265 buf->f_frsize = dentry->d_sb->s_blocksize;
267 266
268 /* 267 /*
269 * On most *nix systems, f_blocks, f_bfree, and f_bavail 268 * On most *nix systems, f_blocks, f_bfree, and f_bavail
@@ -272,8 +271,8 @@ static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf)
272 * thus historically Linux's sys_statfs reports these 271 * thus historically Linux's sys_statfs reports these
273 * fields in units of f_bsize. 272 * fields in units of f_bsize.
274 */ 273 */
275 buf->f_bsize = sb->s_blocksize; 274 buf->f_bsize = dentry->d_sb->s_blocksize;
276 blockbits = sb->s_blocksize_bits; 275 blockbits = dentry->d_sb->s_blocksize_bits;
277 blockres = (1 << blockbits) - 1; 276 blockres = (1 << blockbits) - 1;
278 buf->f_blocks = (res.tbytes + blockres) >> blockbits; 277 buf->f_blocks = (res.tbytes + blockres) >> blockbits;
279 buf->f_bfree = (res.fbytes + blockres) >> blockbits; 278 buf->f_bfree = (res.fbytes + blockres) >> blockbits;