aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2010-04-16 16:22:50 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-05-14 15:09:26 -0400
commit39967ddf19ff98b6e0d7b43fe60bcbf2c254c478 (patch)
tree6667b24c063da2422680a3d4a7b8670e9ef116d6
parentd346890bea062d697e24fb4e34591428021ad011 (diff)
NFS: Reduce the stack footprint of nfs_rmdir
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs3proc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 80378d1283cb..fabb4f2849a1 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -574,7 +574,7 @@ out:
574static int 574static int
575nfs3_proc_rmdir(struct inode *dir, struct qstr *name) 575nfs3_proc_rmdir(struct inode *dir, struct qstr *name)
576{ 576{
577 struct nfs_fattr dir_attr; 577 struct nfs_fattr *dir_attr;
578 struct nfs3_diropargs arg = { 578 struct nfs3_diropargs arg = {
579 .fh = NFS_FH(dir), 579 .fh = NFS_FH(dir),
580 .name = name->name, 580 .name = name->name,
@@ -583,14 +583,19 @@ nfs3_proc_rmdir(struct inode *dir, struct qstr *name)
583 struct rpc_message msg = { 583 struct rpc_message msg = {
584 .rpc_proc = &nfs3_procedures[NFS3PROC_RMDIR], 584 .rpc_proc = &nfs3_procedures[NFS3PROC_RMDIR],
585 .rpc_argp = &arg, 585 .rpc_argp = &arg,
586 .rpc_resp = &dir_attr,
587 }; 586 };
588 int status; 587 int status = -ENOMEM;
589 588
590 dprintk("NFS call rmdir %s\n", name->name); 589 dprintk("NFS call rmdir %s\n", name->name);
591 nfs_fattr_init(&dir_attr); 590 dir_attr = nfs_alloc_fattr();
591 if (dir_attr == NULL)
592 goto out;
593
594 msg.rpc_resp = dir_attr;
592 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 595 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
593 nfs_post_op_update_inode(dir, &dir_attr); 596 nfs_post_op_update_inode(dir, dir_attr);
597 nfs_free_fattr(dir_attr);
598out:
594 dprintk("NFS reply rmdir: %d\n", status); 599 dprintk("NFS reply rmdir: %d\n", status);
595 return status; 600 return status;
596} 601}