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 | 136f2627c932da5835e67e464e191d8c43c3f3fd (patch) | |
tree | 5f6aff24fe7163a260c553f3d4899c4ef51abbf7 /fs/nfs/nfs4proc.c | |
parent | aa49b4cf7dbf45438563f0ff6a2d23a68b70a7b9 (diff) |
NFS: Reduce the stack footprint of nfs_link()
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 14cde99d8a60..0ffd4cfd3b1f 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -2707,28 +2707,30 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr * | |||
2707 | .name = name, | 2707 | .name = name, |
2708 | .bitmask = server->attr_bitmask, | 2708 | .bitmask = server->attr_bitmask, |
2709 | }; | 2709 | }; |
2710 | struct nfs_fattr fattr, dir_attr; | ||
2711 | struct nfs4_link_res res = { | 2710 | struct nfs4_link_res res = { |
2712 | .server = server, | 2711 | .server = server, |
2713 | .fattr = &fattr, | ||
2714 | .dir_attr = &dir_attr, | ||
2715 | }; | 2712 | }; |
2716 | struct rpc_message msg = { | 2713 | struct rpc_message msg = { |
2717 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LINK], | 2714 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LINK], |
2718 | .rpc_argp = &arg, | 2715 | .rpc_argp = &arg, |
2719 | .rpc_resp = &res, | 2716 | .rpc_resp = &res, |
2720 | }; | 2717 | }; |
2721 | int status; | 2718 | int status = -ENOMEM; |
2719 | |||
2720 | res.fattr = nfs_alloc_fattr(); | ||
2721 | res.dir_attr = nfs_alloc_fattr(); | ||
2722 | if (res.fattr == NULL || res.dir_attr == NULL) | ||
2723 | goto out; | ||
2722 | 2724 | ||
2723 | nfs_fattr_init(res.fattr); | ||
2724 | nfs_fattr_init(res.dir_attr); | ||
2725 | status = nfs4_call_sync(server, &msg, &arg, &res, 1); | 2725 | status = nfs4_call_sync(server, &msg, &arg, &res, 1); |
2726 | if (!status) { | 2726 | if (!status) { |
2727 | update_changeattr(dir, &res.cinfo); | 2727 | update_changeattr(dir, &res.cinfo); |
2728 | nfs_post_op_update_inode(dir, res.dir_attr); | 2728 | nfs_post_op_update_inode(dir, res.dir_attr); |
2729 | nfs_post_op_update_inode(inode, res.fattr); | 2729 | nfs_post_op_update_inode(inode, res.fattr); |
2730 | } | 2730 | } |
2731 | 2731 | out: | |
2732 | nfs_free_fattr(res.dir_attr); | ||
2733 | nfs_free_fattr(res.fattr); | ||
2732 | return status; | 2734 | return status; |
2733 | } | 2735 | } |
2734 | 2736 | ||