| .. | .. |
|---|
| 26 | 26 | const struct rpc_procinfo *rpc_proc; /* Procedure information */ |
|---|
| 27 | 27 | void * rpc_argp; /* Arguments */ |
|---|
| 28 | 28 | void * rpc_resp; /* Result */ |
|---|
| 29 | | - struct rpc_cred * rpc_cred; /* Credentials */ |
|---|
| 29 | + const struct cred * rpc_cred; /* Credentials */ |
|---|
| 30 | 30 | }; |
|---|
| 31 | 31 | |
|---|
| 32 | 32 | struct rpc_call_ops; |
|---|
| .. | .. |
|---|
| 35 | 35 | struct list_head list; /* wait queue links */ |
|---|
| 36 | 36 | struct list_head links; /* Links to related tasks */ |
|---|
| 37 | 37 | struct list_head timer_list; /* Timer list */ |
|---|
| 38 | | - unsigned long expires; |
|---|
| 39 | 38 | }; |
|---|
| 40 | 39 | |
|---|
| 41 | 40 | /* |
|---|
| .. | .. |
|---|
| 62 | 61 | struct rpc_wait tk_wait; /* RPC wait */ |
|---|
| 63 | 62 | } u; |
|---|
| 64 | 63 | |
|---|
| 64 | + int tk_rpc_status; /* Result of last RPC operation */ |
|---|
| 65 | + |
|---|
| 65 | 66 | /* |
|---|
| 66 | 67 | * RPC call state |
|---|
| 67 | 68 | */ |
|---|
| .. | .. |
|---|
| 71 | 72 | |
|---|
| 72 | 73 | struct rpc_clnt * tk_client; /* RPC client */ |
|---|
| 73 | 74 | struct rpc_xprt * tk_xprt; /* Transport */ |
|---|
| 75 | + struct rpc_cred * tk_op_cred; /* cred being operated on */ |
|---|
| 74 | 76 | |
|---|
| 75 | 77 | struct rpc_rqst * tk_rqstp; /* RPC request */ |
|---|
| 76 | 78 | |
|---|
| .. | .. |
|---|
| 105 | 107 | struct rpc_task *task; |
|---|
| 106 | 108 | struct rpc_clnt *rpc_client; |
|---|
| 107 | 109 | struct rpc_xprt *rpc_xprt; |
|---|
| 110 | + struct rpc_cred *rpc_op_cred; /* credential being operated on */ |
|---|
| 108 | 111 | const struct rpc_message *rpc_message; |
|---|
| 109 | 112 | const struct rpc_call_ops *callback_ops; |
|---|
| 110 | 113 | void *callback_data; |
|---|
| .. | .. |
|---|
| 118 | 121 | */ |
|---|
| 119 | 122 | #define RPC_TASK_ASYNC 0x0001 /* is an async task */ |
|---|
| 120 | 123 | #define RPC_TASK_SWAPPER 0x0002 /* is swapping in/out */ |
|---|
| 124 | +#define RPC_TASK_NULLCREDS 0x0010 /* Use AUTH_NULL credential */ |
|---|
| 121 | 125 | #define RPC_CALL_MAJORSEEN 0x0020 /* major timeout seen */ |
|---|
| 122 | 126 | #define RPC_TASK_ROOTCREDS 0x0040 /* force root creds */ |
|---|
| 123 | 127 | #define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */ |
|---|
| 124 | | -#define RPC_TASK_KILLED 0x0100 /* task was killed */ |
|---|
| 128 | +#define RPC_TASK_NO_ROUND_ROBIN 0x0100 /* send requests on "main" xprt */ |
|---|
| 125 | 129 | #define RPC_TASK_SOFT 0x0200 /* Use soft timeouts */ |
|---|
| 126 | 130 | #define RPC_TASK_SOFTCONN 0x0400 /* Fail if can't connect */ |
|---|
| 127 | 131 | #define RPC_TASK_SENT 0x0800 /* message was sent */ |
|---|
| 128 | 132 | #define RPC_TASK_TIMEOUT 0x1000 /* fail with ETIMEDOUT on timeout */ |
|---|
| 129 | 133 | #define RPC_TASK_NOCONNECT 0x2000 /* return ENOTCONN if not connected */ |
|---|
| 130 | 134 | #define RPC_TASK_NO_RETRANS_TIMEOUT 0x4000 /* wait forever for a reply */ |
|---|
| 135 | +#define RPC_TASK_CRED_NOREF 0x8000 /* No refcount on the credential */ |
|---|
| 131 | 136 | |
|---|
| 132 | 137 | #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) |
|---|
| 133 | 138 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) |
|---|
| 134 | | -#define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) |
|---|
| 135 | | -#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) |
|---|
| 136 | 139 | #define RPC_IS_SOFT(t) ((t)->tk_flags & (RPC_TASK_SOFT|RPC_TASK_TIMEOUT)) |
|---|
| 137 | 140 | #define RPC_IS_SOFTCONN(t) ((t)->tk_flags & RPC_TASK_SOFTCONN) |
|---|
| 138 | 141 | #define RPC_WAS_SENT(t) ((t)->tk_flags & RPC_TASK_SENT) |
|---|
| .. | .. |
|---|
| 140 | 143 | #define RPC_TASK_RUNNING 0 |
|---|
| 141 | 144 | #define RPC_TASK_QUEUED 1 |
|---|
| 142 | 145 | #define RPC_TASK_ACTIVE 2 |
|---|
| 143 | | -#define RPC_TASK_MSG_RECV 3 |
|---|
| 144 | | -#define RPC_TASK_MSG_RECV_WAIT 4 |
|---|
| 146 | +#define RPC_TASK_NEED_XMIT 3 |
|---|
| 147 | +#define RPC_TASK_NEED_RECV 4 |
|---|
| 148 | +#define RPC_TASK_MSG_PIN_WAIT 5 |
|---|
| 149 | +#define RPC_TASK_SIGNALLED 6 |
|---|
| 145 | 150 | |
|---|
| 146 | 151 | #define RPC_IS_RUNNING(t) test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate) |
|---|
| 147 | 152 | #define rpc_set_running(t) set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate) |
|---|
| .. | .. |
|---|
| 165 | 170 | |
|---|
| 166 | 171 | #define RPC_IS_ACTIVATED(t) test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate) |
|---|
| 167 | 172 | |
|---|
| 173 | +#define RPC_SIGNALLED(t) test_bit(RPC_TASK_SIGNALLED, &(t)->tk_runstate) |
|---|
| 174 | + |
|---|
| 168 | 175 | /* |
|---|
| 169 | 176 | * Task priorities. |
|---|
| 170 | 177 | * Note: if you change these, you must also change |
|---|
| .. | .. |
|---|
| 177 | 184 | #define RPC_NR_PRIORITY (1 + RPC_PRIORITY_PRIVILEGED - RPC_PRIORITY_LOW) |
|---|
| 178 | 185 | |
|---|
| 179 | 186 | struct rpc_timer { |
|---|
| 180 | | - struct timer_list timer; |
|---|
| 181 | 187 | struct list_head list; |
|---|
| 182 | 188 | unsigned long expires; |
|---|
| 189 | + struct delayed_work dwork; |
|---|
| 183 | 190 | }; |
|---|
| 184 | 191 | |
|---|
| 185 | 192 | /* |
|---|
| .. | .. |
|---|
| 213 | 220 | struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req); |
|---|
| 214 | 221 | void rpc_put_task(struct rpc_task *); |
|---|
| 215 | 222 | void rpc_put_task_async(struct rpc_task *); |
|---|
| 223 | +void rpc_signal_task(struct rpc_task *); |
|---|
| 216 | 224 | void rpc_exit_task(struct rpc_task *); |
|---|
| 217 | 225 | void rpc_exit(struct rpc_task *, int); |
|---|
| 218 | 226 | void rpc_release_calldata(const struct rpc_call_ops *, void *); |
|---|
| .. | .. |
|---|
| 221 | 229 | void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); |
|---|
| 222 | 230 | void rpc_init_wait_queue(struct rpc_wait_queue *, const char *); |
|---|
| 223 | 231 | void rpc_destroy_wait_queue(struct rpc_wait_queue *); |
|---|
| 232 | +unsigned long rpc_task_timeout(const struct rpc_task *task); |
|---|
| 233 | +void rpc_sleep_on_timeout(struct rpc_wait_queue *queue, |
|---|
| 234 | + struct rpc_task *task, |
|---|
| 235 | + rpc_action action, |
|---|
| 236 | + unsigned long timeout); |
|---|
| 224 | 237 | void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, |
|---|
| 225 | 238 | rpc_action action); |
|---|
| 239 | +void rpc_sleep_on_priority_timeout(struct rpc_wait_queue *queue, |
|---|
| 240 | + struct rpc_task *task, |
|---|
| 241 | + unsigned long timeout, |
|---|
| 242 | + int priority); |
|---|
| 226 | 243 | void rpc_sleep_on_priority(struct rpc_wait_queue *, |
|---|
| 227 | 244 | struct rpc_task *, |
|---|
| 228 | | - rpc_action action, |
|---|
| 229 | 245 | int priority); |
|---|
| 230 | | -void rpc_wake_up_queued_task_on_wq(struct workqueue_struct *wq, |
|---|
| 231 | | - struct rpc_wait_queue *queue, |
|---|
| 232 | | - struct rpc_task *task); |
|---|
| 233 | 246 | void rpc_wake_up_queued_task(struct rpc_wait_queue *, |
|---|
| 234 | 247 | struct rpc_task *); |
|---|
| 248 | +void rpc_wake_up_queued_task_set_status(struct rpc_wait_queue *, |
|---|
| 249 | + struct rpc_task *, |
|---|
| 250 | + int); |
|---|
| 235 | 251 | void rpc_wake_up(struct rpc_wait_queue *); |
|---|
| 236 | 252 | struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); |
|---|
| 237 | 253 | struct rpc_task *rpc_wake_up_first_on_wq(struct workqueue_struct *wq, |
|---|