aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2010-04-16 16:22:48 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-05-14 15:09:24 -0400
commitc407d41a1612aa487f5a9cb5338ed7dc60fe1da2 (patch)
treec5ad78292ca176a223bf9ea71703a5a372118f8c /fs/nfs/nfs4proc.c
parent4f727296d2428b60138793a0a1207a4085eacf99 (diff)
NFSv4: Reduce stack footprint of nfs4_proc_access() and nfs3_proc_access()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 071fcedd517c..6591bd852f84 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2404,14 +2404,12 @@ static int nfs4_proc_lookup(struct inode *dir, struct qstr *name, struct nfs_fh
2404static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry) 2404static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry)
2405{ 2405{
2406 struct nfs_server *server = NFS_SERVER(inode); 2406 struct nfs_server *server = NFS_SERVER(inode);
2407 struct nfs_fattr fattr;
2408 struct nfs4_accessargs args = { 2407 struct nfs4_accessargs args = {
2409 .fh = NFS_FH(inode), 2408 .fh = NFS_FH(inode),
2410 .bitmask = server->attr_bitmask, 2409 .bitmask = server->attr_bitmask,
2411 }; 2410 };
2412 struct nfs4_accessres res = { 2411 struct nfs4_accessres res = {
2413 .server = server, 2412 .server = server,
2414 .fattr = &fattr,
2415 }; 2413 };
2416 struct rpc_message msg = { 2414 struct rpc_message msg = {
2417 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_ACCESS], 2415 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_ACCESS],
@@ -2438,7 +2436,11 @@ static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry
2438 if (mode & MAY_EXEC) 2436 if (mode & MAY_EXEC)
2439 args.access |= NFS4_ACCESS_EXECUTE; 2437 args.access |= NFS4_ACCESS_EXECUTE;
2440 } 2438 }
2441 nfs_fattr_init(&fattr); 2439
2440 res.fattr = nfs_alloc_fattr();
2441 if (res.fattr == NULL)
2442 return -ENOMEM;
2443
2442 status = nfs4_call_sync(server, &msg, &args, &res, 0); 2444 status = nfs4_call_sync(server, &msg, &args, &res, 0);
2443 if (!status) { 2445 if (!status) {
2444 entry->mask = 0; 2446 entry->mask = 0;
@@ -2448,8 +2450,9 @@ static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry
2448 entry->mask |= MAY_WRITE; 2450 entry->mask |= MAY_WRITE;
2449 if (res.access & (NFS4_ACCESS_LOOKUP|NFS4_ACCESS_EXECUTE)) 2451 if (res.access & (NFS4_ACCESS_LOOKUP|NFS4_ACCESS_EXECUTE))
2450 entry->mask |= MAY_EXEC; 2452 entry->mask |= MAY_EXEC;
2451 nfs_refresh_inode(inode, &fattr); 2453 nfs_refresh_inode(inode, res.fattr);
2452 } 2454 }
2455 nfs_free_fattr(res.fattr);
2453 return status; 2456 return status;
2454} 2457}
2455 2458