Commit 560de0e6 authored by J. Bruce Fields's avatar J. Bruce Fields

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: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent 6d7bbbba
...@@ -180,6 +180,7 @@ nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_host *host, ...@@ -180,6 +180,7 @@ nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_host *host,
struct nlm_block *block; struct nlm_block *block;
struct nlm_rqst *call = NULL; struct nlm_rqst *call = NULL;
nlm_get_host(host);
call = nlm_alloc_call(host); call = nlm_alloc_call(host);
if (call == NULL) if (call == NULL)
return NULL; return NULL;
...@@ -380,8 +381,7 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file, ...@@ -380,8 +381,7 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
*/ */
block = nlmsvc_lookup_block(file, lock); block = nlmsvc_lookup_block(file, lock);
if (block == NULL) { if (block == NULL) {
block = nlmsvc_create_block(rqstp, nlm_get_host(host), file, block = nlmsvc_create_block(rqstp, host, file, lock, cookie);
lock, cookie);
ret = nlm_lck_denied_nolocks; ret = nlm_lck_denied_nolocks;
if (block == NULL) if (block == NULL)
goto out; goto out;
...@@ -476,7 +476,6 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file, ...@@ -476,7 +476,6 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
if (conf == NULL) if (conf == NULL)
return nlm_granted; return nlm_granted;
nlm_get_host(host);
block = nlmsvc_create_block(rqstp, host, file, lock, cookie); block = nlmsvc_create_block(rqstp, host, file, lock, cookie);
if (block == NULL) { if (block == NULL) {
kfree(conf); kfree(conf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment