Commit d9b6cd94 authored by Trond Myklebust's avatar Trond Myklebust

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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 241269bd
...@@ -213,6 +213,7 @@ struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req, ...@@ -213,6 +213,7 @@ struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req,
const struct rpc_call_ops *ops); const struct rpc_call_ops *ops);
void rpc_put_task(struct rpc_task *); void rpc_put_task(struct rpc_task *);
void rpc_exit_task(struct rpc_task *); void rpc_exit_task(struct rpc_task *);
void rpc_exit(struct rpc_task *, int);
void rpc_release_calldata(const struct rpc_call_ops *, void *); void rpc_release_calldata(const struct rpc_call_ops *, void *);
void rpc_killall_tasks(struct rpc_clnt *); void rpc_killall_tasks(struct rpc_clnt *);
void rpc_execute(struct rpc_task *); void rpc_execute(struct rpc_task *);
...@@ -241,12 +242,6 @@ void rpc_destroy_mempool(void); ...@@ -241,12 +242,6 @@ void rpc_destroy_mempool(void);
extern struct workqueue_struct *rpciod_workqueue; extern struct workqueue_struct *rpciod_workqueue;
void rpc_prepare_task(struct rpc_task *task); void rpc_prepare_task(struct rpc_task *task);
static inline void rpc_exit(struct rpc_task *task, int status)
{
task->tk_status = status;
task->tk_action = rpc_exit_task;
}
static inline int rpc_wait_for_completion_task(struct rpc_task *task) static inline int rpc_wait_for_completion_task(struct rpc_task *task)
{ {
return __rpc_wait_for_completion_task(task, NULL); return __rpc_wait_for_completion_task(task, NULL);
......
...@@ -405,14 +405,6 @@ void rpc_wake_up_queued_task(struct rpc_wait_queue *queue, struct rpc_task *task ...@@ -405,14 +405,6 @@ void rpc_wake_up_queued_task(struct rpc_wait_queue *queue, struct rpc_task *task
} }
EXPORT_SYMBOL_GPL(rpc_wake_up_queued_task); EXPORT_SYMBOL_GPL(rpc_wake_up_queued_task);
/*
* Wake up the specified task
*/
static void rpc_wake_up_task(struct rpc_task *task)
{
rpc_wake_up_queued_task(task->tk_waitqueue, task);
}
/* /*
* Wake up the next task on a priority queue. * Wake up the next task on a priority queue.
*/ */
...@@ -600,7 +592,15 @@ void rpc_exit_task(struct rpc_task *task) ...@@ -600,7 +592,15 @@ void rpc_exit_task(struct rpc_task *task)
} }
} }
} }
EXPORT_SYMBOL_GPL(rpc_exit_task);
void rpc_exit(struct rpc_task *task, int status)
{
task->tk_status = status;
task->tk_action = rpc_exit_task;
if (RPC_IS_QUEUED(task))
rpc_wake_up_queued_task(task->tk_waitqueue, task);
}
EXPORT_SYMBOL_GPL(rpc_exit);
void rpc_release_calldata(const struct rpc_call_ops *ops, void *calldata) void rpc_release_calldata(const struct rpc_call_ops *ops, void *calldata)
{ {
...@@ -690,7 +690,6 @@ static void __rpc_execute(struct rpc_task *task) ...@@ -690,7 +690,6 @@ static void __rpc_execute(struct rpc_task *task)
dprintk("RPC: %5u got signal\n", task->tk_pid); dprintk("RPC: %5u got signal\n", task->tk_pid);
task->tk_flags |= RPC_TASK_KILLED; task->tk_flags |= RPC_TASK_KILLED;
rpc_exit(task, -ERESTARTSYS); rpc_exit(task, -ERESTARTSYS);
rpc_wake_up_task(task);
} }
rpc_set_running(task); rpc_set_running(task);
dprintk("RPC: %5u sync task resuming\n", task->tk_pid); dprintk("RPC: %5u sync task resuming\n", task->tk_pid);
...@@ -950,7 +949,6 @@ void rpc_killall_tasks(struct rpc_clnt *clnt) ...@@ -950,7 +949,6 @@ void rpc_killall_tasks(struct rpc_clnt *clnt)
if (!(rovr->tk_flags & RPC_TASK_KILLED)) { if (!(rovr->tk_flags & RPC_TASK_KILLED)) {
rovr->tk_flags |= RPC_TASK_KILLED; rovr->tk_flags |= RPC_TASK_KILLED;
rpc_exit(rovr, -EIO); rpc_exit(rovr, -EIO);
rpc_wake_up_task(rovr);
} }
} }
spin_unlock(&clnt->cl_lock); spin_unlock(&clnt->cl_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment