aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/sched.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-31 19:45:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-31 19:45:47 -0500
commit75659ca0c10992dcb39258518368a0f6f56e935d (patch)
tree5d014ceb2f10158061a23d0d976f9a613d85e659 /net/sunrpc/sched.c
parentfbdde7bd274d74729954190f99afcb1e3d9bbfba (diff)
parent2dfe485a2c8afa54cb069fcf48476f6c90ea3fdf (diff)
Merge branch 'task_killable' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc
* 'task_killable' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc: (22 commits) Remove commented-out code copied from NFS NFS: Switch from intr mount option to TASK_KILLABLE Add wait_for_completion_killable Add wait_event_killable Add schedule_timeout_killable Use mutex_lock_killable in vfs_readdir Add mutex_lock_killable Use lock_page_killable Add lock_page_killable Add fatal_signal_pending Add TASK_WAKEKILL exit: Use task_is_* signal: Use task_is_* sched: Use task_contributes_to_load, TASK_ALL and TASK_NORMAL ptrace: Use task_is_* power: Use task_is_* wait: Use TASK_NORMAL proc/base.c: Use task_is_* proc/array.c: Use TASK_REPORT perfmon: Use task_is_* ... Fixed up conflicts in NFS/sunrpc manually..
Diffstat (limited to 'net/sunrpc/sched.c')
-rw-r--r--net/sunrpc/sched.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 40ce6f6672d6..4c669121e607 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -245,9 +245,9 @@ void rpc_init_wait_queue(struct rpc_wait_queue *queue, const char *qname)
245} 245}
246EXPORT_SYMBOL_GPL(rpc_init_wait_queue); 246EXPORT_SYMBOL_GPL(rpc_init_wait_queue);
247 247
248static int rpc_wait_bit_interruptible(void *word) 248static int rpc_wait_bit_killable(void *word)
249{ 249{
250 if (signal_pending(current)) 250 if (fatal_signal_pending(current))
251 return -ERESTARTSYS; 251 return -ERESTARTSYS;
252 schedule(); 252 schedule();
253 return 0; 253 return 0;
@@ -299,9 +299,9 @@ static void rpc_mark_complete_task(struct rpc_task *task)
299int __rpc_wait_for_completion_task(struct rpc_task *task, int (*action)(void *)) 299int __rpc_wait_for_completion_task(struct rpc_task *task, int (*action)(void *))
300{ 300{
301 if (action == NULL) 301 if (action == NULL)
302 action = rpc_wait_bit_interruptible; 302 action = rpc_wait_bit_killable;
303 return wait_on_bit(&task->tk_runstate, RPC_TASK_ACTIVE, 303 return wait_on_bit(&task->tk_runstate, RPC_TASK_ACTIVE,
304 action, TASK_INTERRUPTIBLE); 304 action, TASK_KILLABLE);
305} 305}
306EXPORT_SYMBOL_GPL(__rpc_wait_for_completion_task); 306EXPORT_SYMBOL_GPL(__rpc_wait_for_completion_task);
307 307
@@ -696,10 +696,9 @@ static void __rpc_execute(struct rpc_task *task)
696 696
697 /* sync task: sleep here */ 697 /* sync task: sleep here */
698 dprintk("RPC: %5u sync task going to sleep\n", task->tk_pid); 698 dprintk("RPC: %5u sync task going to sleep\n", task->tk_pid);
699 /* Note: Caller should be using rpc_clnt_sigmask() */
700 status = out_of_line_wait_on_bit(&task->tk_runstate, 699 status = out_of_line_wait_on_bit(&task->tk_runstate,
701 RPC_TASK_QUEUED, rpc_wait_bit_interruptible, 700 RPC_TASK_QUEUED, rpc_wait_bit_killable,
702 TASK_INTERRUPTIBLE); 701 TASK_KILLABLE);
703 if (status == -ERESTARTSYS) { 702 if (status == -ERESTARTSYS) {
704 /* 703 /*
705 * When a sync task receives a signal, it exits with 704 * When a sync task receives a signal, it exits with
@@ -840,8 +839,6 @@ static void rpc_init_task(struct rpc_task *task, const struct rpc_task_setup *ta
840 kref_get(&task->tk_client->cl_kref); 839 kref_get(&task->tk_client->cl_kref);
841 if (task->tk_client->cl_softrtry) 840 if (task->tk_client->cl_softrtry)
842 task->tk_flags |= RPC_TASK_SOFT; 841 task->tk_flags |= RPC_TASK_SOFT;
843 if (!task->tk_client->cl_intr)
844 task->tk_flags |= RPC_TASK_NOINTR;
845 } 842 }
846 843
847 if (task->tk_ops->rpc_call_prepare != NULL) 844 if (task->tk_ops->rpc_call_prepare != NULL)