aboutsummaryrefslogtreecommitdiff
path: root/fs/lockd/svc4proc.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
commit92737230dd3f1478033819d4bc20339f8da852da (patch)
tree27bc7804a077a29b7614c698bb02632dc4ce228e /fs/lockd/svc4proc.c
parente4cd038a45a46ffbe06a1a72f3f15246e5b041ca (diff)
NLM: Add nlmclnt_release_call
Add a helper function to simplify the freeing of NLM client requests. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd/svc4proc.c')
-rw-r--r--fs/lockd/svc4proc.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index ac4a700af01..cb51c702582 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -480,43 +480,37 @@ nlm4svc_callback(struct svc_rqst *rqstp, u32 proc, struct nlm_res *resp)
struct nlm_host *host;
struct nlm_rqst *call;
- if (!(call = nlmclnt_alloc_call()))
+ host = nlmsvc_lookup_host(rqstp);
+ if (host == NULL)
return rpc_system_err;
- host = nlmsvc_lookup_host(rqstp);
- if (!host) {
- kfree(call);
+ call = nlm_alloc_call(host);
+ if (call == NULL)
return rpc_system_err;
- }
+
call->a_flags = RPC_TASK_ASYNC;
- call->a_host = host;
memcpy(&call->a_args, resp, sizeof(*resp));
- if (nlmsvc_async_call(call, proc, &nlm4svc_callback_ops) < 0)
- goto error;
-
+ if (nlm_async_call(call, proc, &nlm4svc_callback_ops) < 0)
+ return rpc_system_err;
return rpc_success;
- error:
- kfree(call);
- nlm_release_host(host);
- return rpc_system_err;
}
static void nlm4svc_callback_exit(struct rpc_task *task, void *data)
{
- struct nlm_rqst *call = data;
+ dprintk("lockd: %4d callback returned %d\n", task->tk_pid,
+ -task->tk_status);
+}
- if (task->tk_status < 0) {
- dprintk("lockd: %4d callback failed (errno = %d)\n",
- task->tk_pid, -task->tk_status);
- }
- nlm_release_host(call->a_host);
- kfree(call);
+static void nlm4svc_callback_release(void *data)
+{
+ nlm_release_call(data);
}
static const struct rpc_call_ops nlm4svc_callback_ops = {
.rpc_call_done = nlm4svc_callback_exit,
+ .rpc_release = nlm4svc_callback_release,
};
/*