patch-2.1.127 linux/net/sunrpc/sched.c

Next file: linux/net/sunrpc/svcsock.c
Previous file: linux/net/protocols.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.126/linux/net/sunrpc/sched.c linux/net/sunrpc/sched.c
@@ -127,7 +127,7 @@
 			task->tk_pid, task->tk_timeout * 1000 / HZ);
 	if (!timer)
 		timer = __rpc_default_timer;
-	if (expires < jiffies) {
+	if (time_before(expires, jiffies)) {
 		printk(KERN_ERR "RPC: bad timeout value %ld - setting to 10 sec!\n",
 					task->tk_timeout);
 		expires = jiffies + 10 * HZ;
@@ -413,7 +413,6 @@
 							task->tk_pid);
 			if (current->pid == rpciod_pid)
 				printk(KERN_ERR "RPC: rpciod waiting on sync task!\n");
-			current->timeout = 0;
 			sleep_on(&task->tk_wait);
 
 			/*
@@ -552,9 +551,8 @@
 		}
 		if (flags & RPC_TASK_ASYNC)
 			return NULL;
-		current->timeout = jiffies + (HZ >> 4);
 		current->state = TASK_INTERRUPTIBLE;
-		schedule();
+		schedule_timeout(HZ>>4);
 	} while (!signalled());
 
 	return NULL;
@@ -846,9 +844,7 @@
 		if (all_tasks) {
 			dprintk("rpciod_killall: waiting for tasks to exit\n");
 			current->state = TASK_INTERRUPTIBLE;
-			current->timeout = jiffies + 1;
-			schedule();
-			current->timeout = 0;
+			schedule_timeout(1);
 		}
 	}
 
@@ -919,9 +915,7 @@
 	 */
 	current->sigpending = 0;
 	current->state = TASK_INTERRUPTIBLE;
-	current->timeout = jiffies + 1;
-	schedule();
-	current->timeout = 0;
+	schedule_timeout(1);
 	/*
 	 * Display a message if we're going to wait longer.
 	 */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov