summaryrefslogtreecommitdiffstats
path: root/fs/lockd/svclock.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2008-07-15 14:26:17 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-07-15 14:53:33 -0400
commit6cde4de80773497d8333985b135f472eda870904 (patch)
treef6b97fe59c31dbe750b146d785276d44223b7e4c /fs/lockd/svclock.c
parent8f920d5e29f86d3425a68e1c3bc264d1f6f55112 (diff)
downloadlinux-stable-6cde4de80773497d8333985b135f472eda870904.tar.gz
linux-stable-6cde4de80773497d8333985b135f472eda870904.tar.bz2
linux-stable-6cde4de80773497d8333985b135f472eda870904.zip
lockd: eliminate duplicate nlmsvc_lookup_host call from nlmsvc_lock
nlmsvc_lock calls nlmsvc_lookup_host to find a nlm_host struct. The callers of this function, however, call nlmsvc_retrieve_args or nlm4svc_retrieve_args, which also return a nlm_host struct. Change nlmsvc_lock to take a host arg instead of calling nlmsvc_lookup_host itself and change the callers to pass a pointer to the nlm_host they've already found. Since nlmsvc_testlock() now just uses the caller's reference, we no longer need to get or release it. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/lockd/svclock.c')
-rw-r--r--fs/lockd/svclock.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index f40afb3a0e69..bcf73f6e8226 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -358,10 +358,10 @@ nlmsvc_defer_lock_rqst(struct svc_rqst *rqstp, struct nlm_block *block)
*/
__be32
nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
- struct nlm_lock *lock, int wait, struct nlm_cookie *cookie)
+ struct nlm_host *host, struct nlm_lock *lock, int wait,
+ struct nlm_cookie *cookie)
{
struct nlm_block *block = NULL;
- struct nlm_host *host;
int error;
__be32 ret;
@@ -373,11 +373,6 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
(long long)lock->fl.fl_end,
wait);
- /* Create host handle for callback */
- host = nlmsvc_lookup_host(rqstp, lock->caller, lock->len);
- if (host == NULL)
- return nlm_lck_denied_nolocks;
-
/* Lock file against concurrent access */
mutex_lock(&file->f_mutex);
/* Get existing block (in case client is busy-waiting)
@@ -450,7 +445,6 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
out:
mutex_unlock(&file->f_mutex);
nlmsvc_release_block(block);
- nlm_release_host(host);
dprintk("lockd: nlmsvc_lock returned %u\n", ret);
return ret;
}