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 | |
| parent | 3e32a5d99a467b9d4d416323c8c292479b4915e5 (diff) | |
SUNRPC: Fix up missing BKL in asynchronous RPC callback functions
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| -rw-r--r-- | include/linux/sunrpc/sched.h | 1 | ||||
| -rw-r--r-- | net/sunrpc/clnt.c | 3 | ||||
| -rw-r--r-- | net/sunrpc/sched.c | 15 |
3 files changed, 13 insertions, 6 deletions
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 14fc813ddd..b6b6ad6253 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
| @@ -252,6 +252,7 @@ void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, | |||
| 252 | void rpc_put_task(struct rpc_task *); | 252 | void rpc_put_task(struct rpc_task *); |
| 253 | void rpc_release_task(struct rpc_task *); | 253 | void rpc_release_task(struct rpc_task *); |
| 254 | void rpc_exit_task(struct rpc_task *); | 254 | void rpc_exit_task(struct rpc_task *); |
| 255 | void rpc_release_calldata(const struct rpc_call_ops *, void *); | ||
| 255 | void rpc_killall_tasks(struct rpc_clnt *); | 256 | void rpc_killall_tasks(struct rpc_clnt *); |
| 256 | int rpc_execute(struct rpc_task *); | 257 | int rpc_execute(struct rpc_task *); |
| 257 | void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); | 258 | void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 8b78177e75..37d345c04a 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; |
| 543 | out_release: | 543 | out_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 6b808c03fb..9c13050d23 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 | } |
| 609 | EXPORT_SYMBOL(rpc_exit_task); | 609 | EXPORT_SYMBOL(rpc_exit_task); |
| 610 | 610 | ||
| 611 | void 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 | } |
| 889 | EXPORT_SYMBOL(rpc_put_task); | 897 | EXPORT_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); |
