diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-04-16 16:22:49 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:25 -0400 |
commit | 011fff7239eb90e33e7bebba48bf596fced06eb9 (patch) | |
tree | 9bee14976f711a6445d766ab51651244767c6181 /fs/nfs/nfs4proc.c | |
parent | a3cba2aad9c0a63279716d377efbf37c176ed400 (diff) |
NFS: Reduce stack footprint of nfs3_proc_rename() and nfs4_proc_rename()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 6591bd852f84..14cde99d8a60 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -2656,29 +2656,31 @@ static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name, | |||
2656 | .new_name = new_name, | 2656 | .new_name = new_name, |
2657 | .bitmask = server->attr_bitmask, | 2657 | .bitmask = server->attr_bitmask, |
2658 | }; | 2658 | }; |
2659 | struct nfs_fattr old_fattr, new_fattr; | ||
2660 | struct nfs4_rename_res res = { | 2659 | struct nfs4_rename_res res = { |
2661 | .server = server, | 2660 | .server = server, |
2662 | .old_fattr = &old_fattr, | ||
2663 | .new_fattr = &new_fattr, | ||
2664 | }; | 2661 | }; |
2665 | struct rpc_message msg = { | 2662 | struct rpc_message msg = { |
2666 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RENAME], | 2663 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RENAME], |
2667 | .rpc_argp = &arg, | 2664 | .rpc_argp = &arg, |
2668 | .rpc_resp = &res, | 2665 | .rpc_resp = &res, |
2669 | }; | 2666 | }; |
2670 | int status; | 2667 | int status = -ENOMEM; |
2671 | 2668 | ||
2672 | nfs_fattr_init(res.old_fattr); | 2669 | res.old_fattr = nfs_alloc_fattr(); |
2673 | nfs_fattr_init(res.new_fattr); | 2670 | res.new_fattr = nfs_alloc_fattr(); |
2674 | status = nfs4_call_sync(server, &msg, &arg, &res, 1); | 2671 | if (res.old_fattr == NULL || res.new_fattr == NULL) |
2672 | goto out; | ||
2675 | 2673 | ||
2674 | status = nfs4_call_sync(server, &msg, &arg, &res, 1); | ||
2676 | if (!status) { | 2675 | if (!status) { |
2677 | update_changeattr(old_dir, &res.old_cinfo); | 2676 | update_changeattr(old_dir, &res.old_cinfo); |
2678 | nfs_post_op_update_inode(old_dir, res.old_fattr); | 2677 | nfs_post_op_update_inode(old_dir, res.old_fattr); |
2679 | update_changeattr(new_dir, &res.new_cinfo); | 2678 | update_changeattr(new_dir, &res.new_cinfo); |
2680 | nfs_post_op_update_inode(new_dir, res.new_fattr); | 2679 | nfs_post_op_update_inode(new_dir, res.new_fattr); |
2681 | } | 2680 | } |
2681 | out: | ||
2682 | nfs_free_fattr(res.new_fattr); | ||
2683 | nfs_free_fattr(res.old_fattr); | ||
2682 | return status; | 2684 | return status; |
2683 | } | 2685 | } |
2684 | 2686 | ||