diff options
Diffstat (limited to 'include/linux/sunrpc/sched.h')
| -rw-r--r-- | include/linux/sunrpc/sched.h | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 7bc7fd5291ce..88513fd8e208 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #define _LINUX_SUNRPC_SCHED_H_ | 10 | #define _LINUX_SUNRPC_SCHED_H_ |
| 11 | 11 | ||
| 12 | #include <linux/timer.h> | 12 | #include <linux/timer.h> |
| 13 | #include <linux/ktime.h> | ||
| 13 | #include <linux/sunrpc/types.h> | 14 | #include <linux/sunrpc/types.h> |
| 14 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
| 15 | #include <linux/wait.h> | 16 | #include <linux/wait.h> |
| @@ -40,21 +41,15 @@ struct rpc_wait { | |||
| 40 | * This is the RPC task struct | 41 | * This is the RPC task struct |
| 41 | */ | 42 | */ |
| 42 | struct rpc_task { | 43 | struct rpc_task { |
| 43 | #ifdef RPC_DEBUG | ||
| 44 | unsigned long tk_magic; /* 0xf00baa */ | ||
| 45 | #endif | ||
| 46 | atomic_t tk_count; /* Reference count */ | 44 | atomic_t tk_count; /* Reference count */ |
| 47 | struct list_head tk_task; /* global list of tasks */ | 45 | struct list_head tk_task; /* global list of tasks */ |
| 48 | struct rpc_clnt * tk_client; /* RPC client */ | 46 | struct rpc_clnt * tk_client; /* RPC client */ |
| 49 | struct rpc_rqst * tk_rqstp; /* RPC request */ | 47 | struct rpc_rqst * tk_rqstp; /* RPC request */ |
| 50 | int tk_status; /* result of last operation */ | ||
| 51 | 48 | ||
| 52 | /* | 49 | /* |
| 53 | * RPC call state | 50 | * RPC call state |
| 54 | */ | 51 | */ |
| 55 | struct rpc_message tk_msg; /* RPC call info */ | 52 | struct rpc_message tk_msg; /* RPC call info */ |
| 56 | __u8 tk_garb_retry; | ||
| 57 | __u8 tk_cred_retry; | ||
| 58 | 53 | ||
| 59 | /* | 54 | /* |
| 60 | * callback to be executed after waking up | 55 | * callback to be executed after waking up |
| @@ -67,7 +62,6 @@ struct rpc_task { | |||
| 67 | void * tk_calldata; | 62 | void * tk_calldata; |
| 68 | 63 | ||
| 69 | unsigned long tk_timeout; /* timeout for rpc_sleep() */ | 64 | unsigned long tk_timeout; /* timeout for rpc_sleep() */ |
| 70 | unsigned short tk_flags; /* misc flags */ | ||
| 71 | unsigned long tk_runstate; /* Task run status */ | 65 | unsigned long tk_runstate; /* Task run status */ |
| 72 | struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could | 66 | struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could |
| 73 | * be any workqueue | 67 | * be any workqueue |
| @@ -78,17 +72,19 @@ struct rpc_task { | |||
| 78 | struct rpc_wait tk_wait; /* RPC wait */ | 72 | struct rpc_wait tk_wait; /* RPC wait */ |
| 79 | } u; | 73 | } u; |
| 80 | 74 | ||
| 81 | unsigned short tk_timeouts; /* maj timeouts */ | 75 | ktime_t tk_start; /* RPC task init timestamp */ |
| 82 | size_t tk_bytes_sent; /* total bytes sent */ | ||
| 83 | unsigned long tk_start; /* RPC task init timestamp */ | ||
| 84 | long tk_rtt; /* round-trip time (jiffies) */ | ||
| 85 | 76 | ||
| 86 | pid_t tk_owner; /* Process id for batching tasks */ | 77 | pid_t tk_owner; /* Process id for batching tasks */ |
| 87 | unsigned char tk_priority : 2;/* Task priority */ | 78 | int tk_status; /* result of last operation */ |
| 79 | unsigned short tk_flags; /* misc flags */ | ||
| 80 | unsigned short tk_timeouts; /* maj timeouts */ | ||
| 88 | 81 | ||
| 89 | #ifdef RPC_DEBUG | 82 | #ifdef RPC_DEBUG |
| 90 | unsigned short tk_pid; /* debugging aid */ | 83 | unsigned short tk_pid; /* debugging aid */ |
| 91 | #endif | 84 | #endif |
| 85 | unsigned char tk_priority : 2,/* Task priority */ | ||
| 86 | tk_garb_retry : 2, | ||
| 87 | tk_cred_retry : 2; | ||
| 92 | }; | 88 | }; |
| 93 | #define tk_xprt tk_client->cl_xprt | 89 | #define tk_xprt tk_client->cl_xprt |
| 94 | 90 | ||
| @@ -217,6 +213,7 @@ struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req, | |||
| 217 | const struct rpc_call_ops *ops); | 213 | const struct rpc_call_ops *ops); |
| 218 | void rpc_put_task(struct rpc_task *); | 214 | void rpc_put_task(struct rpc_task *); |
| 219 | void rpc_exit_task(struct rpc_task *); | 215 | void rpc_exit_task(struct rpc_task *); |
| 216 | void rpc_exit(struct rpc_task *, int); | ||
| 220 | void rpc_release_calldata(const struct rpc_call_ops *, void *); | 217 | void rpc_release_calldata(const struct rpc_call_ops *, void *); |
| 221 | void rpc_killall_tasks(struct rpc_clnt *); | 218 | void rpc_killall_tasks(struct rpc_clnt *); |
| 222 | void rpc_execute(struct rpc_task *); | 219 | void rpc_execute(struct rpc_task *); |
| @@ -245,12 +242,6 @@ void rpc_destroy_mempool(void); | |||
| 245 | extern struct workqueue_struct *rpciod_workqueue; | 242 | extern struct workqueue_struct *rpciod_workqueue; |
| 246 | void rpc_prepare_task(struct rpc_task *task); | 243 | void rpc_prepare_task(struct rpc_task *task); |
| 247 | 244 | ||
| 248 | static inline void rpc_exit(struct rpc_task *task, int status) | ||
| 249 | { | ||
| 250 | task->tk_status = status; | ||
| 251 | task->tk_action = rpc_exit_task; | ||
| 252 | } | ||
| 253 | |||
| 254 | static inline int rpc_wait_for_completion_task(struct rpc_task *task) | 245 | static inline int rpc_wait_for_completion_task(struct rpc_task *task) |
| 255 | { | 246 | { |
| 256 | return __rpc_wait_for_completion_task(task, NULL); | 247 | return __rpc_wait_for_completion_task(task, NULL); |
