aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/svcproc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-01-03 03:55:04 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-01-06 14:58:39 -0500
commit963d8fe53339128ee46a7701f2e36305f0ccff8c (patch)
tree426736c70a8e05cb1d945d5c7f44ea6475edd113 /fs/lockd/svcproc.c
parentabbcf28f23d53e8ec56a91f3528743913fa2694a (diff)
RPC: Clean up RPC task structure
Shrink the RPC task structure. Instead of storing separate pointers for task->tk_exit and task->tk_release, put them in a structure. Also pass the user data pointer as a parameter instead of passing it via task->tk_calldata. This enables us to nest callbacks. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd/svcproc.c')
-rw-r--r--fs/lockd/svcproc.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index 757e344cf200..3bc437e0cf5b 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -23,7 +23,8 @@
23#define NLMDBG_FACILITY NLMDBG_CLIENT 23#define NLMDBG_FACILITY NLMDBG_CLIENT
24 24
25static u32 nlmsvc_callback(struct svc_rqst *, u32, struct nlm_res *); 25static u32 nlmsvc_callback(struct svc_rqst *, u32, struct nlm_res *);
26static void nlmsvc_callback_exit(struct rpc_task *); 26
27static const struct rpc_call_ops nlmsvc_callback_ops;
27 28
28#ifdef CONFIG_LOCKD_V4 29#ifdef CONFIG_LOCKD_V4
29static u32 30static u32
@@ -518,7 +519,7 @@ nlmsvc_callback(struct svc_rqst *rqstp, u32 proc, struct nlm_res *resp)
518 call->a_host = host; 519 call->a_host = host;
519 memcpy(&call->a_args, resp, sizeof(*resp)); 520 memcpy(&call->a_args, resp, sizeof(*resp));
520 521
521 if (nlmsvc_async_call(call, proc, nlmsvc_callback_exit) < 0) 522 if (nlmsvc_async_call(call, proc, &nlmsvc_callback_ops) < 0)
522 goto error; 523 goto error;
523 524
524 return rpc_success; 525 return rpc_success;
@@ -528,10 +529,9 @@ nlmsvc_callback(struct svc_rqst *rqstp, u32 proc, struct nlm_res *resp)
528 return rpc_system_err; 529 return rpc_system_err;
529} 530}
530 531
531static void 532static void nlmsvc_callback_exit(struct rpc_task *task, void *data)
532nlmsvc_callback_exit(struct rpc_task *task)
533{ 533{
534 struct nlm_rqst *call = (struct nlm_rqst *) task->tk_calldata; 534 struct nlm_rqst *call = data;
535 535
536 if (task->tk_status < 0) { 536 if (task->tk_status < 0) {
537 dprintk("lockd: %4d callback failed (errno = %d)\n", 537 dprintk("lockd: %4d callback failed (errno = %d)\n",
@@ -541,6 +541,10 @@ nlmsvc_callback_exit(struct rpc_task *task)
541 kfree(call); 541 kfree(call);
542} 542}
543 543
544static const struct rpc_call_ops nlmsvc_callback_ops = {
545 .rpc_call_done = nlmsvc_callback_exit,
546};
547
544/* 548/*
545 * NLM Server procedures. 549 * NLM Server procedures.
546 */ 550 */