diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-04-16 20:22:52 (GMT) |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 19:09:27 (GMT) |
commit | ca7e9a0df263493bbdf76f47fd9e9ac48ad6f331 (patch) | |
tree | 2bf783ccad3d6169219cac5b6751f51b31fab7ff /fs | |
parent | 987f8dfc9862f2c7b59594089793dedeebf0cf5e (diff) | |
download | linux-fsl-qoriq-ca7e9a0df263493bbdf76f47fd9e9ac48ad6f331.tar.xz |
NFS: Reduce stack footprint of nfs_statfs()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/super.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index dd589de..98d1ab8 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -423,15 +423,19 @@ static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf) unsigned char blockbits; unsigned long blockres; struct nfs_fh *fh = NFS_FH(dentry->d_inode); - struct nfs_fattr fattr; - struct nfs_fsstat res = { - .fattr = &fattr, - }; - int error; + struct nfs_fsstat res; + int error = -ENOMEM; + + res.fattr = nfs_alloc_fattr(); + if (res.fattr == NULL) + goto out_err; error = server->nfs_client->rpc_ops->statfs(server, fh, &res); + + nfs_free_fattr(res.fattr); if (error < 0) goto out_err; + buf->f_type = NFS_SUPER_MAGIC; /* |