diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-04-16 22:22:50 +0200 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 21:09:25 +0200 |
commit | 3b14d6542d7efbec614277d1cd7d6f5b5a2be9ca (patch) | |
tree | 9813c08c5e85a4f435997125a9ec9fc6eef9d68f /fs/nfs/nfs3proc.c | |
parent | NFS: Reduce the stack footprint of nfs_link() (diff) | |
download | linux-3b14d6542d7efbec614277d1cd7d6f5b5a2be9ca.tar.xz linux-3b14d6542d7efbec614277d1cd7d6f5b5a2be9ca.zip |
NFS: Reduce stack footprint of nfs3_proc_readlink()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to '')
-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: static int nfs3_proc_readlink(struct inode *inode, struct page *page, unsigned int pgbase, unsigned int pglen) { - struct nfs_fattr fattr; + struct nfs_fattr *fattr; struct nfs3_readlinkargs args = { .fh = NFS_FH(inode), .pgbase = pgbase, @@ -244,14 +244,19 @@ static int nfs3_proc_readlink(struct inode *inode, struct page *page, struct rpc_message msg = { .rpc_proc = &nfs3_procedures[NFS3PROC_READLINK], .rpc_argp = &args, - .rpc_resp = &fattr, }; - int status; + int status = -ENOMEM; dprintk("NFS call readlink\n"); - nfs_fattr_init(&fattr); + fattr = nfs_alloc_fattr(); + if (fattr == NULL) + goto out; + msg.rpc_resp = fattr; + status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); - nfs_refresh_inode(inode, &fattr); + nfs_refresh_inode(inode, fattr); + nfs_free_fattr(fattr); +out: dprintk("NFS reply readlink: %d\n", status); return status; } |