aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/clntproc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:45 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:45 -0500
commitd47166244860eb5dfdb12ee4703968beef8a0db2 (patch)
tree423a78e1aefc84b13800e4e257bee30ac4bbcb75 /fs/lockd/clntproc.c
parent92737230dd3f1478033819d4bc20339f8da852da (diff)
lockd: Add helper for *_RES callbacks
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd/clntproc.c')
-rw-r--r--fs/lockd/clntproc.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index 3f8ad7c54efa..f96e38155b5c 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -354,14 +354,10 @@ in_grace_period:
354/* 354/*
355 * Generic NLM call, async version. 355 * Generic NLM call, async version.
356 */ 356 */
357int nlm_async_call(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops) 357static int __nlm_async_call(struct nlm_rqst *req, u32 proc, struct rpc_message *msg, const struct rpc_call_ops *tk_ops)
358{ 358{
359 struct nlm_host *host = req->a_host; 359 struct nlm_host *host = req->a_host;
360 struct rpc_clnt *clnt; 360 struct rpc_clnt *clnt;
361 struct rpc_message msg = {
362 .rpc_argp = &req->a_args,
363 .rpc_resp = &req->a_res,
364 };
365 int status = -ENOLCK; 361 int status = -ENOLCK;
366 362
367 dprintk("lockd: call procedure %d on %s (async)\n", 363 dprintk("lockd: call procedure %d on %s (async)\n",
@@ -371,10 +367,10 @@ int nlm_async_call(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk
371 clnt = nlm_bind_host(host); 367 clnt = nlm_bind_host(host);
372 if (clnt == NULL) 368 if (clnt == NULL)
373 goto out_err; 369 goto out_err;
374 msg.rpc_proc = &clnt->cl_procinfo[proc]; 370 msg->rpc_proc = &clnt->cl_procinfo[proc];
375 371
376 /* bootstrap and kick off the async RPC call */ 372 /* bootstrap and kick off the async RPC call */
377 status = rpc_call_async(clnt, &msg, RPC_TASK_ASYNC, tk_ops, req); 373 status = rpc_call_async(clnt, msg, RPC_TASK_ASYNC, tk_ops, req);
378 if (status == 0) 374 if (status == 0)
379 return 0; 375 return 0;
380out_err: 376out_err:
@@ -382,6 +378,23 @@ out_err:
382 return status; 378 return status;
383} 379}
384 380
381int nlm_async_call(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops)
382{
383 struct rpc_message msg = {
384 .rpc_argp = &req->a_args,
385 .rpc_resp = &req->a_res,
386 };
387 return __nlm_async_call(req, proc, &msg, tk_ops);
388}
389
390int nlm_async_reply(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops)
391{
392 struct rpc_message msg = {
393 .rpc_argp = &req->a_res,
394 };
395 return __nlm_async_call(req, proc, &msg, tk_ops);
396}
397
385/* 398/*
386 * TEST for the presence of a conflicting lock 399 * TEST for the presence of a conflicting lock
387 */ 400 */