Commit 39967ddf authored by Trond Myklebust's avatar Trond Myklebust

NFS: Reduce the stack footprint of nfs_rmdir

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent d346890b
...@@ -574,7 +574,7 @@ nfs3_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr) ...@@ -574,7 +574,7 @@ nfs3_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr)
static int static int
nfs3_proc_rmdir(struct inode *dir, struct qstr *name) nfs3_proc_rmdir(struct inode *dir, struct qstr *name)
{ {
struct nfs_fattr dir_attr; struct nfs_fattr *dir_attr;
struct nfs3_diropargs arg = { struct nfs3_diropargs arg = {
.fh = NFS_FH(dir), .fh = NFS_FH(dir),
.name = name->name, .name = name->name,
...@@ -583,14 +583,19 @@ nfs3_proc_rmdir(struct inode *dir, struct qstr *name) ...@@ -583,14 +583,19 @@ nfs3_proc_rmdir(struct inode *dir, struct qstr *name)
struct rpc_message msg = { struct rpc_message msg = {
.rpc_proc = &nfs3_procedures[NFS3PROC_RMDIR], .rpc_proc = &nfs3_procedures[NFS3PROC_RMDIR],
.rpc_argp = &arg, .rpc_argp = &arg,
.rpc_resp = &dir_attr,
}; };
int status; int status = -ENOMEM;
dprintk("NFS call rmdir %s\n", name->name); dprintk("NFS call rmdir %s\n", name->name);
nfs_fattr_init(&dir_attr); dir_attr = nfs_alloc_fattr();
if (dir_attr == NULL)
goto out;
msg.rpc_resp = dir_attr;
status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
nfs_post_op_update_inode(dir, &dir_attr); nfs_post_op_update_inode(dir, dir_attr);
nfs_free_fattr(dir_attr);
out:
dprintk("NFS reply rmdir: %d\n", status); dprintk("NFS reply rmdir: %d\n", status);
return status; return status;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment