diff options
Diffstat (limited to 'fs/lockd/svcproc.c')
-rw-r--r-- | fs/lockd/svcproc.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c index 0caea5310ac3..d27aab11f324 100644 --- a/fs/lockd/svcproc.c +++ b/fs/lockd/svcproc.c | |||
@@ -80,7 +80,7 @@ nlmsvc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
80 | return 0; | 80 | return 0; |
81 | 81 | ||
82 | no_locks: | 82 | no_locks: |
83 | nlm_release_host(host); | 83 | nlmsvc_release_host(host); |
84 | if (error) | 84 | if (error) |
85 | return error; | 85 | return error; |
86 | return nlm_lck_denied_nolocks; | 86 | return nlm_lck_denied_nolocks; |
@@ -122,7 +122,7 @@ nlmsvc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
122 | dprintk("lockd: TEST status %d vers %d\n", | 122 | dprintk("lockd: TEST status %d vers %d\n", |
123 | ntohl(resp->status), rqstp->rq_vers); | 123 | ntohl(resp->status), rqstp->rq_vers); |
124 | 124 | ||
125 | nlm_release_host(host); | 125 | nlmsvc_release_host(host); |
126 | nlm_release_file(file); | 126 | nlm_release_file(file); |
127 | return rc; | 127 | return rc; |
128 | } | 128 | } |
@@ -164,7 +164,7 @@ nlmsvc_proc_lock(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
164 | else | 164 | else |
165 | dprintk("lockd: LOCK status %d\n", ntohl(resp->status)); | 165 | dprintk("lockd: LOCK status %d\n", ntohl(resp->status)); |
166 | 166 | ||
167 | nlm_release_host(host); | 167 | nlmsvc_release_host(host); |
168 | nlm_release_file(file); | 168 | nlm_release_file(file); |
169 | return rc; | 169 | return rc; |
170 | } | 170 | } |
@@ -194,7 +194,7 @@ nlmsvc_proc_cancel(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
194 | resp->status = cast_status(nlmsvc_cancel_blocked(file, &argp->lock)); | 194 | resp->status = cast_status(nlmsvc_cancel_blocked(file, &argp->lock)); |
195 | 195 | ||
196 | dprintk("lockd: CANCEL status %d\n", ntohl(resp->status)); | 196 | dprintk("lockd: CANCEL status %d\n", ntohl(resp->status)); |
197 | nlm_release_host(host); | 197 | nlmsvc_release_host(host); |
198 | nlm_release_file(file); | 198 | nlm_release_file(file); |
199 | return rpc_success; | 199 | return rpc_success; |
200 | } | 200 | } |
@@ -227,7 +227,7 @@ nlmsvc_proc_unlock(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
227 | resp->status = cast_status(nlmsvc_unlock(file, &argp->lock)); | 227 | resp->status = cast_status(nlmsvc_unlock(file, &argp->lock)); |
228 | 228 | ||
229 | dprintk("lockd: UNLOCK status %d\n", ntohl(resp->status)); | 229 | dprintk("lockd: UNLOCK status %d\n", ntohl(resp->status)); |
230 | nlm_release_host(host); | 230 | nlmsvc_release_host(host); |
231 | nlm_release_file(file); | 231 | nlm_release_file(file); |
232 | return rpc_success; | 232 | return rpc_success; |
233 | } | 233 | } |
@@ -257,9 +257,17 @@ static void nlmsvc_callback_exit(struct rpc_task *task, void *data) | |||
257 | -task->tk_status); | 257 | -task->tk_status); |
258 | } | 258 | } |
259 | 259 | ||
260 | void nlmsvc_release_call(struct nlm_rqst *call) | ||
261 | { | ||
262 | if (!atomic_dec_and_test(&call->a_count)) | ||
263 | return; | ||
264 | nlmsvc_release_host(call->a_host); | ||
265 | kfree(call); | ||
266 | } | ||
267 | |||
260 | static void nlmsvc_callback_release(void *data) | 268 | static void nlmsvc_callback_release(void *data) |
261 | { | 269 | { |
262 | nlm_release_call(data); | 270 | nlmsvc_release_call(data); |
263 | } | 271 | } |
264 | 272 | ||
265 | static const struct rpc_call_ops nlmsvc_callback_ops = { | 273 | static const struct rpc_call_ops nlmsvc_callback_ops = { |
@@ -291,7 +299,7 @@ static __be32 nlmsvc_callback(struct svc_rqst *rqstp, u32 proc, struct nlm_args | |||
291 | 299 | ||
292 | stat = func(rqstp, argp, &call->a_res); | 300 | stat = func(rqstp, argp, &call->a_res); |
293 | if (stat != 0) { | 301 | if (stat != 0) { |
294 | nlm_release_call(call); | 302 | nlmsvc_release_call(call); |
295 | return stat; | 303 | return stat; |
296 | } | 304 | } |
297 | 305 | ||
@@ -366,7 +374,7 @@ nlmsvc_proc_share(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
366 | resp->status = cast_status(nlmsvc_share_file(host, file, argp)); | 374 | resp->status = cast_status(nlmsvc_share_file(host, file, argp)); |
367 | 375 | ||
368 | dprintk("lockd: SHARE status %d\n", ntohl(resp->status)); | 376 | dprintk("lockd: SHARE status %d\n", ntohl(resp->status)); |
369 | nlm_release_host(host); | 377 | nlmsvc_release_host(host); |
370 | nlm_release_file(file); | 378 | nlm_release_file(file); |
371 | return rpc_success; | 379 | return rpc_success; |
372 | } | 380 | } |
@@ -399,7 +407,7 @@ nlmsvc_proc_unshare(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
399 | resp->status = cast_status(nlmsvc_unshare_file(host, file, argp)); | 407 | resp->status = cast_status(nlmsvc_unshare_file(host, file, argp)); |
400 | 408 | ||
401 | dprintk("lockd: UNSHARE status %d\n", ntohl(resp->status)); | 409 | dprintk("lockd: UNSHARE status %d\n", ntohl(resp->status)); |
402 | nlm_release_host(host); | 410 | nlmsvc_release_host(host); |
403 | nlm_release_file(file); | 411 | nlm_release_file(file); |
404 | return rpc_success; | 412 | return rpc_success; |
405 | } | 413 | } |
@@ -431,7 +439,7 @@ nlmsvc_proc_free_all(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
431 | return rpc_success; | 439 | return rpc_success; |
432 | 440 | ||
433 | nlmsvc_free_host_resources(host); | 441 | nlmsvc_free_host_resources(host); |
434 | nlm_release_host(host); | 442 | nlmsvc_release_host(host); |
435 | return rpc_success; | 443 | return rpc_success; |
436 | } | 444 | } |
437 | 445 | ||