| .. | .. |
|---|
| 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 | |
|---|
| .. | .. |
|---|
| 88 | 90 | #endif |
|---|
| 89 | 91 | unsigned char tk_priority : 2,/* Task priority */ |
|---|
| 90 | 92 | tk_garb_retry : 2, |
|---|
| 91 | | - tk_cred_retry : 2, |
|---|
| 92 | | - tk_rebind_retry : 2; |
|---|
| 93 | + tk_cred_retry : 2; |
|---|
| 93 | 94 | }; |
|---|
| 94 | 95 | |
|---|
| 95 | 96 | typedef void (*rpc_action)(struct rpc_task *); |
|---|
| .. | .. |
|---|
| 105 | 106 | struct rpc_task *task; |
|---|
| 106 | 107 | struct rpc_clnt *rpc_client; |
|---|
| 107 | 108 | struct rpc_xprt *rpc_xprt; |
|---|
| 109 | + struct rpc_cred *rpc_op_cred; /* credential being operated on */ |
|---|
| 108 | 110 | const struct rpc_message *rpc_message; |
|---|
| 109 | 111 | const struct rpc_call_ops *callback_ops; |
|---|
| 110 | 112 | void *callback_data; |
|---|
| .. | .. |
|---|
| 118 | 120 | */ |
|---|
| 119 | 121 | #define RPC_TASK_ASYNC 0x0001 /* is an async task */ |
|---|
| 120 | 122 | #define RPC_TASK_SWAPPER 0x0002 /* is swapping in/out */ |
|---|
| 123 | +#define RPC_TASK_NULLCREDS 0x0010 /* Use AUTH_NULL credential */ |
|---|
| 121 | 124 | #define RPC_CALL_MAJORSEEN 0x0020 /* major timeout seen */ |
|---|
| 122 | 125 | #define RPC_TASK_ROOTCREDS 0x0040 /* force root creds */ |
|---|
| 123 | 126 | #define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */ |
|---|
| 124 | | -#define RPC_TASK_KILLED 0x0100 /* task was killed */ |
|---|
| 127 | +#define RPC_TASK_NO_ROUND_ROBIN 0x0100 /* send requests on "main" xprt */ |
|---|
| 125 | 128 | #define RPC_TASK_SOFT 0x0200 /* Use soft timeouts */ |
|---|
| 126 | 129 | #define RPC_TASK_SOFTCONN 0x0400 /* Fail if can't connect */ |
|---|
| 127 | 130 | #define RPC_TASK_SENT 0x0800 /* message was sent */ |
|---|
| 128 | 131 | #define RPC_TASK_TIMEOUT 0x1000 /* fail with ETIMEDOUT on timeout */ |
|---|
| 129 | 132 | #define RPC_TASK_NOCONNECT 0x2000 /* return ENOTCONN if not connected */ |
|---|
| 130 | 133 | #define RPC_TASK_NO_RETRANS_TIMEOUT 0x4000 /* wait forever for a reply */ |
|---|
| 134 | +#define RPC_TASK_CRED_NOREF 0x8000 /* No refcount on the credential */ |
|---|
| 131 | 135 | |
|---|
| 132 | 136 | #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) |
|---|
| 133 | 137 | #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 | 138 | #define RPC_IS_SOFT(t) ((t)->tk_flags & (RPC_TASK_SOFT|RPC_TASK_TIMEOUT)) |
|---|
| 137 | 139 | #define RPC_IS_SOFTCONN(t) ((t)->tk_flags & RPC_TASK_SOFTCONN) |
|---|
| 138 | 140 | #define RPC_WAS_SENT(t) ((t)->tk_flags & RPC_TASK_SENT) |
|---|
| .. | .. |
|---|
| 140 | 142 | #define RPC_TASK_RUNNING 0 |
|---|
| 141 | 143 | #define RPC_TASK_QUEUED 1 |
|---|
| 142 | 144 | #define RPC_TASK_ACTIVE 2 |
|---|
| 143 | | -#define RPC_TASK_MSG_RECV 3 |
|---|
| 144 | | -#define RPC_TASK_MSG_RECV_WAIT 4 |
|---|
| 145 | +#define RPC_TASK_NEED_XMIT 3 |
|---|
| 146 | +#define RPC_TASK_NEED_RECV 4 |
|---|
| 147 | +#define RPC_TASK_MSG_PIN_WAIT 5 |
|---|
| 148 | +#define RPC_TASK_SIGNALLED 6 |
|---|
| 145 | 149 | |
|---|
| 146 | 150 | #define RPC_IS_RUNNING(t) test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate) |
|---|
| 147 | 151 | #define rpc_set_running(t) set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate) |
|---|
| .. | .. |
|---|
| 165 | 169 | |
|---|
| 166 | 170 | #define RPC_IS_ACTIVATED(t) test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate) |
|---|
| 167 | 171 | |
|---|
| 172 | +#define RPC_SIGNALLED(t) test_bit(RPC_TASK_SIGNALLED, &(t)->tk_runstate) |
|---|
| 173 | + |
|---|
| 168 | 174 | /* |
|---|
| 169 | 175 | * Task priorities. |
|---|
| 170 | 176 | * Note: if you change these, you must also change |
|---|
| .. | .. |
|---|
| 177 | 183 | #define RPC_NR_PRIORITY (1 + RPC_PRIORITY_PRIVILEGED - RPC_PRIORITY_LOW) |
|---|
| 178 | 184 | |
|---|
| 179 | 185 | struct rpc_timer { |
|---|
| 180 | | - struct timer_list timer; |
|---|
| 181 | 186 | struct list_head list; |
|---|
| 182 | 187 | unsigned long expires; |
|---|
| 188 | + struct delayed_work dwork; |
|---|
| 183 | 189 | }; |
|---|
| 184 | 190 | |
|---|
| 185 | 191 | /* |
|---|
| .. | .. |
|---|
| 213 | 219 | struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req); |
|---|
| 214 | 220 | void rpc_put_task(struct rpc_task *); |
|---|
| 215 | 221 | void rpc_put_task_async(struct rpc_task *); |
|---|
| 222 | +void rpc_signal_task(struct rpc_task *); |
|---|
| 216 | 223 | void rpc_exit_task(struct rpc_task *); |
|---|
| 217 | 224 | void rpc_exit(struct rpc_task *, int); |
|---|
| 218 | 225 | void rpc_release_calldata(const struct rpc_call_ops *, void *); |
|---|
| .. | .. |
|---|
| 221 | 228 | void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); |
|---|
| 222 | 229 | void rpc_init_wait_queue(struct rpc_wait_queue *, const char *); |
|---|
| 223 | 230 | void rpc_destroy_wait_queue(struct rpc_wait_queue *); |
|---|
| 231 | +unsigned long rpc_task_timeout(const struct rpc_task *task); |
|---|
| 232 | +void rpc_sleep_on_timeout(struct rpc_wait_queue *queue, |
|---|
| 233 | + struct rpc_task *task, |
|---|
| 234 | + rpc_action action, |
|---|
| 235 | + unsigned long timeout); |
|---|
| 224 | 236 | void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, |
|---|
| 225 | 237 | rpc_action action); |
|---|
| 238 | +void rpc_sleep_on_priority_timeout(struct rpc_wait_queue *queue, |
|---|
| 239 | + struct rpc_task *task, |
|---|
| 240 | + unsigned long timeout, |
|---|
| 241 | + int priority); |
|---|
| 226 | 242 | void rpc_sleep_on_priority(struct rpc_wait_queue *, |
|---|
| 227 | 243 | struct rpc_task *, |
|---|
| 228 | | - rpc_action action, |
|---|
| 229 | 244 | 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 | 245 | void rpc_wake_up_queued_task(struct rpc_wait_queue *, |
|---|
| 234 | 246 | struct rpc_task *); |
|---|
| 247 | +void rpc_wake_up_queued_task_set_status(struct rpc_wait_queue *, |
|---|
| 248 | + struct rpc_task *, |
|---|
| 249 | + int); |
|---|
| 235 | 250 | void rpc_wake_up(struct rpc_wait_queue *); |
|---|
| 236 | 251 | struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); |
|---|
| 237 | 252 | struct rpc_task *rpc_wake_up_first_on_wq(struct workqueue_struct *wq, |
|---|