aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/svclock.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/svclock.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/svclock.c')
-rw-r--r--fs/lockd/svclock.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 49f959796b66..87d09a0d8f64 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -41,7 +41,8 @@
41 41
42static void nlmsvc_insert_block(struct nlm_block *block, unsigned long); 42static void nlmsvc_insert_block(struct nlm_block *block, unsigned long);
43static int nlmsvc_remove_block(struct nlm_block *block); 43static int nlmsvc_remove_block(struct nlm_block *block);
44static void nlmsvc_grant_callback(struct rpc_task *task); 44
45static const struct rpc_call_ops nlmsvc_grant_ops;
45 46
46/* 47/*
47 * The list of blocked locks to retry 48 * The list of blocked locks to retry
@@ -562,7 +563,7 @@ callback:
562 /* Call the client */ 563 /* Call the client */
563 nlm_get_host(block->b_call.a_host); 564 nlm_get_host(block->b_call.a_host);
564 if (nlmsvc_async_call(&block->b_call, NLMPROC_GRANTED_MSG, 565 if (nlmsvc_async_call(&block->b_call, NLMPROC_GRANTED_MSG,
565 nlmsvc_grant_callback) < 0) 566 &nlmsvc_grant_ops) < 0)
566 nlm_release_host(block->b_call.a_host); 567 nlm_release_host(block->b_call.a_host);
567 up(&file->f_sema); 568 up(&file->f_sema);
568} 569}
@@ -575,10 +576,9 @@ callback:
575 * chain once more in order to have it removed by lockd itself (which can 576 * chain once more in order to have it removed by lockd itself (which can
576 * then sleep on the file semaphore without disrupting e.g. the nfs client). 577 * then sleep on the file semaphore without disrupting e.g. the nfs client).
577 */ 578 */
578static void 579static void nlmsvc_grant_callback(struct rpc_task *task, void *data)
579nlmsvc_grant_callback(struct rpc_task *task)
580{ 580{
581 struct nlm_rqst *call = (struct nlm_rqst *) task->tk_calldata; 581 struct nlm_rqst *call = data;
582 struct nlm_block *block; 582 struct nlm_block *block;
583 unsigned long timeout; 583 unsigned long timeout;
584 struct sockaddr_in *peer_addr = RPC_PEERADDR(task->tk_client); 584 struct sockaddr_in *peer_addr = RPC_PEERADDR(task->tk_client);
@@ -614,6 +614,10 @@ nlmsvc_grant_callback(struct rpc_task *task)
614 nlm_release_host(call->a_host); 614 nlm_release_host(call->a_host);
615} 615}
616 616
617static const struct rpc_call_ops nlmsvc_grant_ops = {
618 .rpc_call_done = nlmsvc_grant_callback,
619};
620
617/* 621/*
618 * We received a GRANT_RES callback. Try to find the corresponding 622 * We received a GRANT_RES callback. Try to find the corresponding
619 * block. 623 * block.