aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/lockd/clntproc.c12
-rw-r--r--fs/lockd/svc4proc.c4
-rw-r--r--fs/lockd/svclock.c4
-rw-r--r--fs/lockd/svcproc.c12
-rw-r--r--include/linux/lockd/lockd.h3
5 files changed, 22 insertions, 13 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index 332c54cf75e0..fbc6617f76c4 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -211,7 +211,7 @@ struct nlm_rqst *nlm_alloc_call(struct nlm_host *host)
211 return NULL; 211 return NULL;
212} 212}
213 213
214void nlm_release_call(struct nlm_rqst *call) 214void nlmclnt_release_call(struct nlm_rqst *call)
215{ 215{
216 if (!atomic_dec_and_test(&call->a_count)) 216 if (!atomic_dec_and_test(&call->a_count))
217 return; 217 return;
@@ -222,7 +222,7 @@ void nlm_release_call(struct nlm_rqst *call)
222 222
223static void nlmclnt_rpc_release(void *data) 223static void nlmclnt_rpc_release(void *data)
224{ 224{
225 nlm_release_call(data); 225 nlmclnt_release_call(data);
226} 226}
227 227
228static int nlm_wait_on_grace(wait_queue_head_t *queue) 228static int nlm_wait_on_grace(wait_queue_head_t *queue)
@@ -436,7 +436,7 @@ nlmclnt_test(struct nlm_rqst *req, struct file_lock *fl)
436 status = nlm_stat_to_errno(req->a_res.status); 436 status = nlm_stat_to_errno(req->a_res.status);
437 } 437 }
438out: 438out:
439 nlm_release_call(req); 439 nlmclnt_release_call(req);
440 return status; 440 return status;
441} 441}
442 442
@@ -593,7 +593,7 @@ again:
593out_unblock: 593out_unblock:
594 nlmclnt_finish_block(block); 594 nlmclnt_finish_block(block);
595out: 595out:
596 nlm_release_call(req); 596 nlmclnt_release_call(req);
597 return status; 597 return status;
598out_unlock: 598out_unlock:
599 /* Fatal error: ensure that we remove the lock altogether */ 599 /* Fatal error: ensure that we remove the lock altogether */
@@ -694,7 +694,7 @@ nlmclnt_unlock(struct nlm_rqst *req, struct file_lock *fl)
694 /* What to do now? I'm out of my depth... */ 694 /* What to do now? I'm out of my depth... */
695 status = -ENOLCK; 695 status = -ENOLCK;
696out: 696out:
697 nlm_release_call(req); 697 nlmclnt_release_call(req);
698 return status; 698 return status;
699} 699}
700 700
@@ -755,7 +755,7 @@ static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl
755 NLMPROC_CANCEL, &nlmclnt_cancel_ops); 755 NLMPROC_CANCEL, &nlmclnt_cancel_ops);
756 if (status == 0 && req->a_res.status == nlm_lck_denied) 756 if (status == 0 && req->a_res.status == nlm_lck_denied)
757 status = -ENOLCK; 757 status = -ENOLCK;
758 nlm_release_call(req); 758 nlmclnt_release_call(req);
759 return status; 759 return status;
760} 760}
761 761
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index 38d261192453..c187422026d8 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -229,7 +229,7 @@ static void nlm4svc_callback_exit(struct rpc_task *task, void *data)
229 229
230static void nlm4svc_callback_release(void *data) 230static void nlm4svc_callback_release(void *data)
231{ 231{
232 nlm_release_call(data); 232 nlmsvc_release_call(data);
233} 233}
234 234
235static const struct rpc_call_ops nlm4svc_callback_ops = { 235static const struct rpc_call_ops nlm4svc_callback_ops = {
@@ -261,7 +261,7 @@ static __be32 nlm4svc_callback(struct svc_rqst *rqstp, u32 proc, struct nlm_args
261 261
262 stat = func(rqstp, argp, &call->a_res); 262 stat = func(rqstp, argp, &call->a_res);
263 if (stat != 0) { 263 if (stat != 0) {
264 nlm_release_call(call); 264 nlmsvc_release_call(call);
265 return stat; 265 return stat;
266 } 266 }
267 267
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 9266c4600208..6e31695d046f 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -234,7 +234,7 @@ nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_host *host,
234failed_free: 234failed_free:
235 kfree(block); 235 kfree(block);
236failed: 236failed:
237 nlm_release_call(call); 237 nlmsvc_release_call(call);
238 return NULL; 238 return NULL;
239} 239}
240 240
@@ -267,7 +267,7 @@ static void nlmsvc_free_block(struct kref *kref)
267 mutex_unlock(&file->f_mutex); 267 mutex_unlock(&file->f_mutex);
268 268
269 nlmsvc_freegrantargs(block->b_call); 269 nlmsvc_freegrantargs(block->b_call);
270 nlm_release_call(block->b_call); 270 nlmsvc_release_call(block->b_call);
271 nlm_release_file(block->b_file); 271 nlm_release_file(block->b_file);
272 kfree(block->b_fl); 272 kfree(block->b_fl);
273 kfree(block); 273 kfree(block);
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index 0caea5310ac3..0df65ec29e43 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -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
260void nlmsvc_release_call(struct nlm_rqst *call)
261{
262 if (!atomic_dec_and_test(&call->a_count))
263 return;
264 nlm_release_host(call->a_host);
265 kfree(call);
266}
267
260static void nlmsvc_callback_release(void *data) 268static void nlmsvc_callback_release(void *data)
261{ 269{
262 nlm_release_call(data); 270 nlmsvc_release_call(data);
263} 271}
264 272
265static const struct rpc_call_ops nlmsvc_callback_ops = { 273static 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
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 2dee05e5119a..a32ba62455af 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -202,9 +202,9 @@ extern u32 nsm_local_state;
202 * Lockd client functions 202 * Lockd client functions
203 */ 203 */
204struct nlm_rqst * nlm_alloc_call(struct nlm_host *host); 204struct nlm_rqst * nlm_alloc_call(struct nlm_host *host);
205void nlm_release_call(struct nlm_rqst *);
206int nlm_async_call(struct nlm_rqst *, u32, const struct rpc_call_ops *); 205int nlm_async_call(struct nlm_rqst *, u32, const struct rpc_call_ops *);
207int nlm_async_reply(struct nlm_rqst *, u32, const struct rpc_call_ops *); 206int nlm_async_reply(struct nlm_rqst *, u32, const struct rpc_call_ops *);
207void nlmclnt_release_call(struct nlm_rqst *);
208struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl); 208struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl);
209void nlmclnt_finish_block(struct nlm_wait *block); 209void nlmclnt_finish_block(struct nlm_wait *block);
210int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout); 210int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout);
@@ -267,6 +267,7 @@ unsigned long nlmsvc_retry_blocked(void);
267void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, 267void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
268 nlm_host_match_fn_t match); 268 nlm_host_match_fn_t match);
269void nlmsvc_grant_reply(struct nlm_cookie *, __be32); 269void nlmsvc_grant_reply(struct nlm_cookie *, __be32);
270void nlmsvc_release_call(struct nlm_rqst *);
270 271
271/* 272/*
272 * File handling for the server personality 273 * File handling for the server personality