aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/clntproc.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-07-25 16:39:50 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-29 15:09:57 -0400
commit446945ab9a82515af4b099107eda27050e077c58 (patch)
tree1be9a17759fc754d44a10549a2b43a5aa84a8e2f /fs/lockd/clntproc.c
parenta51d9eaa41866ab6b4b6ecad7b621f8b66ece0dc (diff)
lockd: shift grabbing a reference to nlm_host into nlm_alloc_call()
It's used both for client and server hosts; we can't do nlmclnt_release_host() on failure exits, since the host might need nlmsvc_release_host(), with BUG_ON() for calling the wrong one. Makes life simpler for callers, actually... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/lockd/clntproc.c')
-rw-r--r--fs/lockd/clntproc.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index 8392cb85bd54..27c74f32671b 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -156,7 +156,6 @@ int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl)
156 struct nlm_rqst *call; 156 struct nlm_rqst *call;
157 int status; 157 int status;
158 158
159 nlm_get_host(host);
160 call = nlm_alloc_call(host); 159 call = nlm_alloc_call(host);
161 if (call == NULL) 160 if (call == NULL)
162 return -ENOMEM; 161 return -ENOMEM;
@@ -185,9 +184,6 @@ EXPORT_SYMBOL_GPL(nlmclnt_proc);
185 184
186/* 185/*
187 * Allocate an NLM RPC call struct 186 * Allocate an NLM RPC call struct
188 *
189 * Note: the caller must hold a reference to host. In case of failure,
190 * this reference will be released.
191 */ 187 */
192struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) 188struct nlm_rqst *nlm_alloc_call(struct nlm_host *host)
193{ 189{
@@ -199,7 +195,7 @@ struct nlm_rqst *nlm_alloc_call(struct nlm_host *host)
199 atomic_set(&call->a_count, 1); 195 atomic_set(&call->a_count, 1);
200 locks_init_lock(&call->a_args.lock.fl); 196 locks_init_lock(&call->a_args.lock.fl);
201 locks_init_lock(&call->a_res.lock.fl); 197 locks_init_lock(&call->a_res.lock.fl);
202 call->a_host = host; 198 call->a_host = nlm_get_host(host);
203 return call; 199 return call;
204 } 200 }
205 if (signalled()) 201 if (signalled())
@@ -207,7 +203,6 @@ struct nlm_rqst *nlm_alloc_call(struct nlm_host *host)
207 printk("nlm_alloc_call: failed, waiting for memory\n"); 203 printk("nlm_alloc_call: failed, waiting for memory\n");
208 schedule_timeout_interruptible(5*HZ); 204 schedule_timeout_interruptible(5*HZ);
209 } 205 }
210 nlmclnt_release_host(host);
211 return NULL; 206 return NULL;
212} 207}
213 208
@@ -750,7 +745,7 @@ static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl
750 dprintk("lockd: blocking lock attempt was interrupted by a signal.\n" 745 dprintk("lockd: blocking lock attempt was interrupted by a signal.\n"
751 " Attempting to cancel lock.\n"); 746 " Attempting to cancel lock.\n");
752 747
753 req = nlm_alloc_call(nlm_get_host(host)); 748 req = nlm_alloc_call(host);
754 if (!req) 749 if (!req)
755 return -ENOMEM; 750 return -ENOMEM;
756 req->a_flags = RPC_TASK_ASYNC; 751 req->a_flags = RPC_TASK_ASYNC;