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