aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/clnt.c3
-rw-r--r--net/sunrpc/sched.c15
2 files changed, 12 insertions, 6 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 8b78177e7575..37d345c04aa5 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,
541 rpc_restore_sigmask(&oldset); 541 rpc_restore_sigmask(&oldset);
542 return status; 542 return status;
543out_release: 543out_release:
544 if (tk_ops->rpc_release != NULL) 544 rpc_release_calldata(tk_ops, data);
545 tk_ops->rpc_release(data);
546 return status; 545 return status;
547} 546}
548 547
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);