diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-04-16 16:22:50 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:25 -0400 |
commit | 3b14d6542d7efbec614277d1cd7d6f5b5a2be9ca (patch) | |
tree | 9813c08c5e85a4f435997125a9ec9fc6eef9d68f /fs | |
parent | 136f2627c932da5835e67e464e191d8c43c3f3fd (diff) |
NFS: Reduce stack footprint of nfs3_proc_readlink()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/nfs3proc.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 982a81bb7257..088dceb513b8 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
@@ -234,7 +234,7 @@ out: | |||
234 | static int nfs3_proc_readlink(struct inode *inode, struct page *page, | 234 | static int nfs3_proc_readlink(struct inode *inode, struct page *page, |
235 | unsigned int pgbase, unsigned int pglen) | 235 | unsigned int pgbase, unsigned int pglen) |
236 | { | 236 | { |
237 | struct nfs_fattr fattr; | 237 | struct nfs_fattr *fattr; |
238 | struct nfs3_readlinkargs args = { | 238 | struct nfs3_readlinkargs args = { |
239 | .fh = NFS_FH(inode), | 239 | .fh = NFS_FH(inode), |
240 | .pgbase = pgbase, | 240 | .pgbase = pgbase, |
@@ -244,14 +244,19 @@ static int nfs3_proc_readlink(struct inode *inode, struct page *page, | |||
244 | struct rpc_message msg = { | 244 | struct rpc_message msg = { |
245 | .rpc_proc = &nfs3_procedures[NFS3PROC_READLINK], | 245 | .rpc_proc = &nfs3_procedures[NFS3PROC_READLINK], |
246 | .rpc_argp = &args, | 246 | .rpc_argp = &args, |
247 | .rpc_resp = &fattr, | ||
248 | }; | 247 | }; |
249 | int status; | 248 | int status = -ENOMEM; |
250 | 249 | ||
251 | dprintk("NFS call readlink\n"); | 250 | dprintk("NFS call readlink\n"); |
252 | nfs_fattr_init(&fattr); | 251 | fattr = nfs_alloc_fattr(); |
252 | if (fattr == NULL) | ||
253 | goto out; | ||
254 | msg.rpc_resp = fattr; | ||
255 | |||
253 | status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); | 256 | status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); |
254 | nfs_refresh_inode(inode, &fattr); | 257 | nfs_refresh_inode(inode, fattr); |
258 | nfs_free_fattr(fattr); | ||
259 | out: | ||
255 | dprintk("NFS reply readlink: %d\n", status); | 260 | dprintk("NFS reply readlink: %d\n", status); |
256 | return status; | 261 | return status; |
257 | } | 262 | } |