diff options
author | Chuck Lever <cel@netapp.com> | 2006-03-20 13:44:23 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:23 -0500 |
commit | dead28da8e3fb32601d38fb32b7021122e0a3d21 (patch) | |
tree | a1a23e27e08345c86ed0d9812f848470b615eb34 /fs/nfs/nfs3acl.c | |
parent | cc0175c1dc1de8f6af0eb0631dcc5b999a6fcc42 (diff) |
SUNRPC: eliminate rpc_call()
Clean-up: replace rpc_call() helper with direct call to rpc_call_sync.
This makes NFSv2 and NFSv3 synchronous calls more computationally
efficient, and reduces stack consumption in functions that used to
invoke rpc_call more than once.
Test plan:
Compile kernel with CONFIG_NFS enabled. Connectathon on NFS version 2,
version 3, and version 4 mount points.
Signed-off-by: Chuck Lever <cel@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs3acl.c')
-rw-r--r-- | fs/nfs/nfs3acl.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c index 6a5bbc0ae941..33287879bd23 100644 --- a/fs/nfs/nfs3acl.c +++ b/fs/nfs/nfs3acl.c | |||
@@ -190,6 +190,10 @@ struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type) | |||
190 | struct nfs3_getaclres res = { | 190 | struct nfs3_getaclres res = { |
191 | .fattr = &fattr, | 191 | .fattr = &fattr, |
192 | }; | 192 | }; |
193 | struct rpc_message msg = { | ||
194 | .rpc_argp = &args, | ||
195 | .rpc_resp = &res, | ||
196 | }; | ||
193 | struct posix_acl *acl; | 197 | struct posix_acl *acl; |
194 | int status, count; | 198 | int status, count; |
195 | 199 | ||
@@ -218,8 +222,8 @@ struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type) | |||
218 | return NULL; | 222 | return NULL; |
219 | 223 | ||
220 | dprintk("NFS call getacl\n"); | 224 | dprintk("NFS call getacl\n"); |
221 | status = rpc_call(server->client_acl, ACLPROC3_GETACL, | 225 | msg.rpc_proc = &server->client_acl->cl_procinfo[ACLPROC3_GETACL]; |
222 | &args, &res, 0); | 226 | status = rpc_call_sync(server->client_acl, &msg, 0); |
223 | dprintk("NFS reply getacl: %d\n", status); | 227 | dprintk("NFS reply getacl: %d\n", status); |
224 | 228 | ||
225 | /* pages may have been allocated at the xdr layer. */ | 229 | /* pages may have been allocated at the xdr layer. */ |
@@ -286,6 +290,10 @@ static int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, | |||
286 | .acl_access = acl, | 290 | .acl_access = acl, |
287 | .pages = pages, | 291 | .pages = pages, |
288 | }; | 292 | }; |
293 | struct rpc_message msg = { | ||
294 | .rpc_argp = &args, | ||
295 | .rpc_resp = &fattr, | ||
296 | }; | ||
289 | int status, count; | 297 | int status, count; |
290 | 298 | ||
291 | status = -EOPNOTSUPP; | 299 | status = -EOPNOTSUPP; |
@@ -306,8 +314,8 @@ static int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, | |||
306 | 314 | ||
307 | dprintk("NFS call setacl\n"); | 315 | dprintk("NFS call setacl\n"); |
308 | nfs_begin_data_update(inode); | 316 | nfs_begin_data_update(inode); |
309 | status = rpc_call(server->client_acl, ACLPROC3_SETACL, | 317 | msg.rpc_proc = &server->client_acl->cl_procinfo[ACLPROC3_SETACL]; |
310 | &args, &fattr, 0); | 318 | status = rpc_call_sync(server->client_acl, &msg, 0); |
311 | spin_lock(&inode->i_lock); | 319 | spin_lock(&inode->i_lock); |
312 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ACCESS; | 320 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ACCESS; |
313 | spin_unlock(&inode->i_lock); | 321 | spin_unlock(&inode->i_lock); |