hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/include/linux/sunrpc/sched.h
....@@ -26,7 +26,7 @@
2626 const struct rpc_procinfo *rpc_proc; /* Procedure information */
2727 void * rpc_argp; /* Arguments */
2828 void * rpc_resp; /* Result */
29
- struct rpc_cred * rpc_cred; /* Credentials */
29
+ const struct cred * rpc_cred; /* Credentials */
3030 };
3131
3232 struct rpc_call_ops;
....@@ -35,7 +35,6 @@
3535 struct list_head list; /* wait queue links */
3636 struct list_head links; /* Links to related tasks */
3737 struct list_head timer_list; /* Timer list */
38
- unsigned long expires;
3938 };
4039
4140 /*
....@@ -62,6 +61,8 @@
6261 struct rpc_wait tk_wait; /* RPC wait */
6362 } u;
6463
64
+ int tk_rpc_status; /* Result of last RPC operation */
65
+
6566 /*
6667 * RPC call state
6768 */
....@@ -71,6 +72,7 @@
7172
7273 struct rpc_clnt * tk_client; /* RPC client */
7374 struct rpc_xprt * tk_xprt; /* Transport */
75
+ struct rpc_cred * tk_op_cred; /* cred being operated on */
7476
7577 struct rpc_rqst * tk_rqstp; /* RPC request */
7678
....@@ -105,6 +107,7 @@
105107 struct rpc_task *task;
106108 struct rpc_clnt *rpc_client;
107109 struct rpc_xprt *rpc_xprt;
110
+ struct rpc_cred *rpc_op_cred; /* credential being operated on */
108111 const struct rpc_message *rpc_message;
109112 const struct rpc_call_ops *callback_ops;
110113 void *callback_data;
....@@ -118,21 +121,21 @@
118121 */
119122 #define RPC_TASK_ASYNC 0x0001 /* is an async task */
120123 #define RPC_TASK_SWAPPER 0x0002 /* is swapping in/out */
124
+#define RPC_TASK_NULLCREDS 0x0010 /* Use AUTH_NULL credential */
121125 #define RPC_CALL_MAJORSEEN 0x0020 /* major timeout seen */
122126 #define RPC_TASK_ROOTCREDS 0x0040 /* force root creds */
123127 #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 */
125129 #define RPC_TASK_SOFT 0x0200 /* Use soft timeouts */
126130 #define RPC_TASK_SOFTCONN 0x0400 /* Fail if can't connect */
127131 #define RPC_TASK_SENT 0x0800 /* message was sent */
128132 #define RPC_TASK_TIMEOUT 0x1000 /* fail with ETIMEDOUT on timeout */
129133 #define RPC_TASK_NOCONNECT 0x2000 /* return ENOTCONN if not connected */
130134 #define RPC_TASK_NO_RETRANS_TIMEOUT 0x4000 /* wait forever for a reply */
135
+#define RPC_TASK_CRED_NOREF 0x8000 /* No refcount on the credential */
131136
132137 #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC)
133138 #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)
136139 #define RPC_IS_SOFT(t) ((t)->tk_flags & (RPC_TASK_SOFT|RPC_TASK_TIMEOUT))
137140 #define RPC_IS_SOFTCONN(t) ((t)->tk_flags & RPC_TASK_SOFTCONN)
138141 #define RPC_WAS_SENT(t) ((t)->tk_flags & RPC_TASK_SENT)
....@@ -140,8 +143,10 @@
140143 #define RPC_TASK_RUNNING 0
141144 #define RPC_TASK_QUEUED 1
142145 #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
145150
146151 #define RPC_IS_RUNNING(t) test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)
147152 #define rpc_set_running(t) set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)
....@@ -165,6 +170,8 @@
165170
166171 #define RPC_IS_ACTIVATED(t) test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate)
167172
173
+#define RPC_SIGNALLED(t) test_bit(RPC_TASK_SIGNALLED, &(t)->tk_runstate)
174
+
168175 /*
169176 * Task priorities.
170177 * Note: if you change these, you must also change
....@@ -177,9 +184,9 @@
177184 #define RPC_NR_PRIORITY (1 + RPC_PRIORITY_PRIVILEGED - RPC_PRIORITY_LOW)
178185
179186 struct rpc_timer {
180
- struct timer_list timer;
181187 struct list_head list;
182188 unsigned long expires;
189
+ struct delayed_work dwork;
183190 };
184191
185192 /*
....@@ -213,6 +220,7 @@
213220 struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req);
214221 void rpc_put_task(struct rpc_task *);
215222 void rpc_put_task_async(struct rpc_task *);
223
+void rpc_signal_task(struct rpc_task *);
216224 void rpc_exit_task(struct rpc_task *);
217225 void rpc_exit(struct rpc_task *, int);
218226 void rpc_release_calldata(const struct rpc_call_ops *, void *);
....@@ -221,17 +229,25 @@
221229 void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *);
222230 void rpc_init_wait_queue(struct rpc_wait_queue *, const char *);
223231 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);
224237 void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *,
225238 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);
226243 void rpc_sleep_on_priority(struct rpc_wait_queue *,
227244 struct rpc_task *,
228
- rpc_action action,
229245 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);
233246 void rpc_wake_up_queued_task(struct rpc_wait_queue *,
234247 struct rpc_task *);
248
+void rpc_wake_up_queued_task_set_status(struct rpc_wait_queue *,
249
+ struct rpc_task *,
250
+ int);
235251 void rpc_wake_up(struct rpc_wait_queue *);
236252 struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *);
237253 struct rpc_task *rpc_wake_up_first_on_wq(struct workqueue_struct *wq,