diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-10-18 16:01:05 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-12-06 10:46:29 -0500 |
commit | bbd5a1f9fc9fad0f8725812d91c51b052e847de8 (patch) | |
tree | 252650d49dd498a67c404b7c4c1abeb2dc341624 /net/sunrpc | |
parent | 3e32a5d99a467b9d4d416323c8c292479b4915e5 (diff) |
SUNRPC: Fix up missing BKL in asynchronous RPC callback functions
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/clnt.c | 3 | ||||
-rw-r--r-- | net/sunrpc/sched.c | 15 |
2 files changed, 12 insertions, 6 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 8b78177e757..37d345c04aa 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -541,8 +541,7 @@ rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, int flags, rpc_restore_sigmask(&oldset); return status; out_release: - if (tk_ops->rpc_release != NULL) - tk_ops->rpc_release(data); + rpc_release_calldata(tk_ops, data); return status; } diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index 6b808c03fb7..9c13050d23e 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -608,6 +608,15 @@ void rpc_exit_task(struct rpc_task *task) } EXPORT_SYMBOL(rpc_exit_task); +void rpc_release_calldata(const struct rpc_call_ops *ops, void *calldata) +{ + if (ops->rpc_release != NULL) { + lock_kernel(); + ops->rpc_release(calldata); + unlock_kernel(); + } +} + /* * This is the RPC `scheduler' (or rather, the finite state machine). */ @@ -883,8 +892,7 @@ void rpc_put_task(struct rpc_task *task) } if (task->tk_flags & RPC_TASK_DYNAMIC) call_rcu_bh(&task->u.tk_rcu, rpc_free_task); - if (tk_ops->rpc_release) - tk_ops->rpc_release(calldata); + rpc_release_calldata(tk_ops, calldata); } EXPORT_SYMBOL(rpc_put_task); @@ -928,8 +936,7 @@ struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags, struct rpc_task *task; task = rpc_new_task(clnt, flags, ops, data); if (task == NULL) { - if (ops->rpc_release != NULL) - ops->rpc_release(data); + rpc_release_calldata(ops, data); return ERR_PTR(-ENOMEM); } atomic_inc(&task->tk_count); |