aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2010-07-31 14:29:08 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-08-04 08:54:07 -0400
commitd9b6cd94601e1d17273f93a326a135fbf487a918 (patch)
tree5c616c0717551d02d16da685fbbd93344859fa28 /net
parent241269bd0b580faae71575443d9ab38df7469126 (diff)
SUNRPC: Ensure that rpc_exit() always wakes up a sleeping task
Make rpc_exit() non-inline, and ensure that it always wakes up a task that has been queued. Kill off the now unused rpc_wake_up_task(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/sched.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 4a843b883b89..37452762af70 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -406,14 +406,6 @@ void rpc_wake_up_queued_task(struct rpc_wait_queue *queue, struct rpc_task *task
406EXPORT_SYMBOL_GPL(rpc_wake_up_queued_task); 406EXPORT_SYMBOL_GPL(rpc_wake_up_queued_task);
407 407
408/* 408/*
409 * Wake up the specified task
410 */
411static void rpc_wake_up_task(struct rpc_task *task)
412{
413 rpc_wake_up_queued_task(task->tk_waitqueue, task);
414}
415
416/*
417 * Wake up the next task on a priority queue. 409 * Wake up the next task on a priority queue.
418 */ 410 */
419static struct rpc_task * __rpc_wake_up_next_priority(struct rpc_wait_queue *queue) 411static struct rpc_task * __rpc_wake_up_next_priority(struct rpc_wait_queue *queue)
@@ -600,7 +592,15 @@ void rpc_exit_task(struct rpc_task *task)
600 } 592 }
601 } 593 }
602} 594}
603EXPORT_SYMBOL_GPL(rpc_exit_task); 595
596void rpc_exit(struct rpc_task *task, int status)
597{
598 task->tk_status = status;
599 task->tk_action = rpc_exit_task;
600 if (RPC_IS_QUEUED(task))
601 rpc_wake_up_queued_task(task->tk_waitqueue, task);
602}
603EXPORT_SYMBOL_GPL(rpc_exit);
604 604
605void rpc_release_calldata(const struct rpc_call_ops *ops, void *calldata) 605void rpc_release_calldata(const struct rpc_call_ops *ops, void *calldata)
606{ 606{
@@ -690,7 +690,6 @@ static void __rpc_execute(struct rpc_task *task)
690 dprintk("RPC: %5u got signal\n", task->tk_pid); 690 dprintk("RPC: %5u got signal\n", task->tk_pid);
691 task->tk_flags |= RPC_TASK_KILLED; 691 task->tk_flags |= RPC_TASK_KILLED;
692 rpc_exit(task, -ERESTARTSYS); 692 rpc_exit(task, -ERESTARTSYS);
693 rpc_wake_up_task(task);
694 } 693 }
695 rpc_set_running(task); 694 rpc_set_running(task);
696 dprintk("RPC: %5u sync task resuming\n", task->tk_pid); 695 dprintk("RPC: %5u sync task resuming\n", task->tk_pid);
@@ -950,7 +949,6 @@ void rpc_killall_tasks(struct rpc_clnt *clnt)
950 if (!(rovr->tk_flags & RPC_TASK_KILLED)) { 949 if (!(rovr->tk_flags & RPC_TASK_KILLED)) {
951 rovr->tk_flags |= RPC_TASK_KILLED; 950 rovr->tk_flags |= RPC_TASK_KILLED;
952 rpc_exit(rovr, -EIO); 951 rpc_exit(rovr, -EIO);
953 rpc_wake_up_task(rovr);
954 } 952 }
955 } 953 }
956 spin_unlock(&clnt->cl_lock); 954 spin_unlock(&clnt->cl_lock);