mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 15:19:51 +00:00
NFS: Reduce stack footprint of nfs3_proc_readlink()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
136f2627c9
commit
3b14d6542d
@ -234,7 +234,7 @@ out:
|
|||||||
static int nfs3_proc_readlink(struct inode *inode, struct page *page,
|
static int nfs3_proc_readlink(struct inode *inode, struct page *page,
|
||||||
unsigned int pgbase, unsigned int pglen)
|
unsigned int pgbase, unsigned int pglen)
|
||||||
{
|
{
|
||||||
struct nfs_fattr fattr;
|
struct nfs_fattr *fattr;
|
||||||
struct nfs3_readlinkargs args = {
|
struct nfs3_readlinkargs args = {
|
||||||
.fh = NFS_FH(inode),
|
.fh = NFS_FH(inode),
|
||||||
.pgbase = pgbase,
|
.pgbase = pgbase,
|
||||||
@ -244,14 +244,19 @@ static int nfs3_proc_readlink(struct inode *inode, struct page *page,
|
|||||||
struct rpc_message msg = {
|
struct rpc_message msg = {
|
||||||
.rpc_proc = &nfs3_procedures[NFS3PROC_READLINK],
|
.rpc_proc = &nfs3_procedures[NFS3PROC_READLINK],
|
||||||
.rpc_argp = &args,
|
.rpc_argp = &args,
|
||||||
.rpc_resp = &fattr,
|
|
||||||
};
|
};
|
||||||
int status;
|
int status = -ENOMEM;
|
||||||
|
|
||||||
dprintk("NFS call readlink\n");
|
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);
|
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);
|
dprintk("NFS reply readlink: %d\n", status);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user