summaryrefslogtreecommitdiffstats
path: root/fs/lockd/svclock.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2008-07-15 15:05:45 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-07-15 15:40:25 -0400
commit560de0e65904db392e1c443c4bf5ee750573336b (patch)
tree1d6fcfe7fadd5b20ac2f70db6d45d4f8391023f9 /fs/lockd/svclock.c
parent6d7bbbbacc5202eaabbc232681cc325b22a73eeb (diff)
downloadlinux-560de0e65904db392e1c443c4bf5ee750573336b.tar.bz2
lockd: get host reference in nlmsvc_create_block() instead of callers
It may not be obvious (till you look at the definition of nlm_alloc_call()) that a function like nlmsvc_create_block() should consume a reference on success or failure, so I find it clearer if it takes the reference it needs itself. And both callers already do this immediately before the call anyway. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/lockd/svclock.c')
-rw-r--r--fs/lockd/svclock.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 51a0dea0ae8a..b8f86b73a85d 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -180,6 +180,7 @@ nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_host *host,
struct nlm_block *block;
struct nlm_rqst *call = NULL;
+ nlm_get_host(host);
call = nlm_alloc_call(host);
if (call == NULL)
return NULL;
@@ -380,8 +381,7 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
*/
block = nlmsvc_lookup_block(file, lock);
if (block == NULL) {
- block = nlmsvc_create_block(rqstp, nlm_get_host(host), file,
- lock, cookie);
+ block = nlmsvc_create_block(rqstp, host, file, lock, cookie);
ret = nlm_lck_denied_nolocks;
if (block == NULL)
goto out;
@@ -476,7 +476,6 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
if (conf == NULL)
return nlm_granted;
- nlm_get_host(host);
block = nlmsvc_create_block(rqstp, host, file, lock, cookie);
if (block == NULL) {
kfree(conf);