patch-2.2.19 linux/include/linux/sunrpc/sched.h

Next file: linux/include/linux/sunrpc/xprt.h
Previous file: linux/include/linux/sunrpc/clnt.h
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.18/include/linux/sunrpc/sched.h linux/include/linux/sunrpc/sched.h
@@ -45,7 +45,7 @@
 	struct rpc_task *	tk_parent;	/* parent task */
 	struct rpc_clnt *	tk_client;	/* RPC client */
 	struct rpc_rqst *	tk_rqstp;	/* RPC request */
-	volatile int		tk_status;	/* result of last operation */
+	int			tk_status;	/* result of last operation */
 	struct rpc_wait_queue *	tk_rpcwait;	/* RPC wait queue we're on */
 
 	/*
@@ -81,8 +81,7 @@
 	unsigned int		tk_lock;	/* Task lock counter */
 	unsigned char		tk_active   : 1,/* Task has been activated */
 				tk_wakeup   : 1;/* Task waiting to wake up */
-	volatile unsigned char	tk_running  : 1,/* Task is running */
-				tk_sleeping : 1;/* Task is truly asleep */
+	unsigned int		tk_runstate;	/* Task run status */
 #ifdef RPC_DEBUG
 	unsigned int		tk_pid;		/* debugging aid */
 #endif
@@ -112,10 +111,20 @@
 #define RPC_IS_SWAPPER(t)	((t)->tk_flags & RPC_TASK_SWAPPER)
 #define RPC_DO_ROOTOVERRIDE(t)	((t)->tk_flags & RPC_TASK_ROOTCREDS)
 #define RPC_ASSASSINATED(t)	((t)->tk_flags & RPC_TASK_KILLED)
-#define RPC_IS_RUNNING(t)	((t)->tk_running)
-#define RPC_IS_SLEEPING(t)	((t)->tk_sleeping)
 #define RPC_IS_ACTIVATED(t)	((t)->tk_active)
 #define RPC_DO_CALLBACK(t)	((t)->tk_callback != NULL)
+
+#define RPC_TASK_SLEEPING	0
+#define RPC_TASK_RUNNING	1
+#define RPC_IS_SLEEPING(t)	(test_bit(RPC_TASK_SLEEPING, &(t)->tk_runstate))
+#define RPC_IS_RUNNING(t)	(test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate))
+
+#define rpc_set_running(t)	(set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate))
+#define rpc_clear_running(t)	(clear_bit(RPC_TASK_RUNNING, &(t)->tk_runstate))
+
+#define rpc_set_sleeping(t)	(set_bit(RPC_TASK_SLEEPING, &(t)->tk_runstate))
+
+#define rpc_clear_sleeping(t)	(clear_bit(RPC_TASK_SLEEPING, &(t)->tk_runstate))
 
 /*
  * RPC synchronization objects

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)