aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/sched.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-10-18 16:01:05 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-06 10:46:29 -0500
commitbbd5a1f9fc9fad0f8725812d91c51b052e847de8 (patch)
tree252650d49dd498a67c404b7c4c1abeb2dc341624 /net/sunrpc/sched.c
parent3e32a5d99a467b9d4d416323c8c292479b4915e5 (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/sched.c')
-rw-r--r--net/sunrpc/sched.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 6b808c03fb72..9c13050d23eb 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -608,6 +608,15 @@ void rpc_exit_task(struct rpc_task *task)
608} 608}
609EXPORT_SYMBOL(rpc_exit_task); 609EXPORT_SYMBOL(rpc_exit_task);
610 610
611void rpc_release_calldata(const struct rpc_call_ops *ops, void *calldata)
612{
613 if (ops->rpc_release != NULL) {
614 lock_kernel();
615 ops->rpc_release(calldata);
616 unlock_kernel();
617 }
618}
619
611/* 620/*
612 * This is the RPC `scheduler' (or rather, the finite state machine). 621 * This is the RPC `scheduler' (or rather, the finite state machine).
613 */ 622 */
@@ -883,8 +892,7 @@ void rpc_put_task(struct rpc_task *task)
883 } 892 }
884 if (task->tk_flags & RPC_TASK_DYNAMIC) 893 if (task->tk_flags & RPC_TASK_DYNAMIC)
885 call_rcu_bh(&task->u.tk_rcu, rpc_free_task); 894 call_rcu_bh(&task->u.tk_rcu, rpc_free_task);
886 if (tk_ops->rpc_release) 895 rpc_release_calldata(tk_ops, calldata);
887 tk_ops->rpc_release(calldata);
888} 896}
889EXPORT_SYMBOL(rpc_put_task); 897EXPORT_SYMBOL(rpc_put_task);
890 898
@@ -928,8 +936,7 @@ struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags,
928 struct rpc_task *task; 936 struct rpc_task *task;
929 task = rpc_new_task(clnt, flags, ops, data); 937 task = rpc_new_task(clnt, flags, ops, data);
930 if (task == NULL) { 938 if (task == NULL) {
931 if (ops->rpc_release != NULL) 939 rpc_release_calldata(ops, data);
932 ops->rpc_release(data);
933 return ERR_PTR(-ENOMEM); 940 return ERR_PTR(-ENOMEM);
934 } 941 }
935 atomic_inc(&task->tk_count); 942 atomic_inc(&task->tk_count);