diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-11-28 03:58:46 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-11-28 03:58:46 +0000 |
commit | b63ad0882a16a5d28003e57f2b0b81dee3fb322b (patch) | |
tree | 0a343ce219e2b8b38a5d702d66032c57b83d9720 /include/linux/sunrpc | |
parent | a9d7bff9a84dba79609a0002e5321b74c4d64c64 (diff) |
Merge with 2.4.0-test11.
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r-- | include/linux/sunrpc/debug.h | 2 | ||||
-rw-r--r-- | include/linux/sunrpc/sched.h | 22 |
2 files changed, 19 insertions, 5 deletions
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index eb55e776c..5d1f842c8 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h @@ -54,7 +54,7 @@ extern unsigned int nlm_debug; #undef ifdebug #ifdef RPC_DEBUG # define ifdebug(fac) if (rpc_debug & RPCDBG_##fac) -# define dfprintk(fac, args...) do { ifdebug(fac) printk(## args); } while(0) +# define dfprintk(fac, args...) do { ifdebug(fac) printk(args); } while(0) # define RPC_IFDEBUG(x) x #else # define dfprintk(fac, args...) do ; while (0) diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 8b559703a..f3e9ad2be 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -80,8 +80,7 @@ struct rpc_task { unsigned short 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 short tk_pid; /* debugging aid */ #endif @@ -110,11 +109,26 @@ typedef void (*rpc_action)(struct rpc_task *); #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) \ + do { \ + smp_mb__before_clear_bit(); \ + clear_bit(RPC_TASK_SLEEPING, &(t)->tk_runstate); \ + smp_mb__after_clear_bit(); \ + } while(0) + /* * RPC synchronization objects */ |