From: Trond Myklebust Date: Fri, 16 Apr 2010 20:22:52 +0000 (-0400) Subject: NFS: Reduce stack footprint of nfs_statfs() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ca7e9a0df263493bbdf76f47fd9e9ac48ad6f331;p=linux-beck.git NFS: Reduce stack footprint of nfs_statfs() Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/super.c b/fs/nfs/super.c index dd589dee1eea..98d1ab8bf8f2 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; /*