hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
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
....@@ -88,8 +90,7 @@
8890 #endif
8991 unsigned char tk_priority : 2,/* Task priority */
9092 tk_garb_retry : 2,
91
- tk_cred_retry : 2,
92
- tk_rebind_retry : 2;
93
+ tk_cred_retry : 2;
9394 };
9495
9596 typedef void (*rpc_action)(struct rpc_task *);
....@@ -105,6 +106,7 @@
105106 struct rpc_task *task;
106107 struct rpc_clnt *rpc_client;
107108 struct rpc_xprt *rpc_xprt;
109
+ struct rpc_cred *rpc_op_cred; /* credential being operated on */
108110 const struct rpc_message *rpc_message;
109111 const struct rpc_call_ops *callback_ops;
110112 void *callback_data;
....@@ -118,21 +120,21 @@
118120 */
119121 #define RPC_TASK_ASYNC 0x0001 /* is an async task */
120122 #define RPC_TASK_SWAPPER 0x0002 /* is swapping in/out */
123
+#define RPC_TASK_NULLCREDS 0x0010 /* Use AUTH_NULL credential */
121124 #define RPC_CALL_MAJORSEEN 0x0020 /* major timeout seen */
122125 #define RPC_TASK_ROOTCREDS 0x0040 /* force root creds */
123126 #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 */
125128 #define RPC_TASK_SOFT 0x0200 /* Use soft timeouts */
126129 #define RPC_TASK_SOFTCONN 0x0400 /* Fail if can't connect */
127130 #define RPC_TASK_SENT 0x0800 /* message was sent */
128131 #define RPC_TASK_TIMEOUT 0x1000 /* fail with ETIMEDOUT on timeout */
129132 #define RPC_TASK_NOCONNECT 0x2000 /* return ENOTCONN if not connected */
130133 #define RPC_TASK_NO_RETRANS_TIMEOUT 0x4000 /* wait forever for a reply */
134
+#define RPC_TASK_CRED_NOREF 0x8000 /* No refcount on the credential */
131135
132136 #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC)
133137 #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)
136138 #define RPC_IS_SOFT(t) ((t)->tk_flags & (RPC_TASK_SOFT|RPC_TASK_TIMEOUT))
137139 #define RPC_IS_SOFTCONN(t) ((t)->tk_flags & RPC_TASK_SOFTCONN)
138140 #define RPC_WAS_SENT(t) ((t)->tk_flags & RPC_TASK_SENT)
....@@ -140,8 +142,10 @@
140142 #define RPC_TASK_RUNNING 0
141143 #define RPC_TASK_QUEUED 1
142144 #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
145149
146150 #define RPC_IS_RUNNING(t) test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)
147151 #define rpc_set_running(t) set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)
....@@ -165,6 +169,8 @@
165169
166170 #define RPC_IS_ACTIVATED(t) test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate)
167171
172
+#define RPC_SIGNALLED(t) test_bit(RPC_TASK_SIGNALLED, &(t)->tk_runstate)
173
+
168174 /*
169175 * Task priorities.
170176 * Note: if you change these, you must also change
....@@ -177,9 +183,9 @@
177183 #define RPC_NR_PRIORITY (1 + RPC_PRIORITY_PRIVILEGED - RPC_PRIORITY_LOW)
178184
179185 struct rpc_timer {
180
- struct timer_list timer;
181186 struct list_head list;
182187 unsigned long expires;
188
+ struct delayed_work dwork;
183189 };
184190
185191 /*
....@@ -213,6 +219,7 @@
213219 struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req);
214220 void rpc_put_task(struct rpc_task *);
215221 void rpc_put_task_async(struct rpc_task *);
222
+void rpc_signal_task(struct rpc_task *);
216223 void rpc_exit_task(struct rpc_task *);
217224 void rpc_exit(struct rpc_task *, int);
218225 void rpc_release_calldata(const struct rpc_call_ops *, void *);
....@@ -221,17 +228,25 @@
221228 void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *);
222229 void rpc_init_wait_queue(struct rpc_wait_queue *, const char *);
223230 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);
224236 void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *,
225237 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);
226242 void rpc_sleep_on_priority(struct rpc_wait_queue *,
227243 struct rpc_task *,
228
- rpc_action action,
229244 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);
233245 void rpc_wake_up_queued_task(struct rpc_wait_queue *,
234246 struct rpc_task *);
247
+void rpc_wake_up_queued_task_set_status(struct rpc_wait_queue *,
248
+ struct rpc_task *,
249
+ int);
235250 void rpc_wake_up(struct rpc_wait_queue *);
236251 struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *);
237252 struct rpc_task *rpc_wake_up_first_on_wq(struct workqueue_struct *wq,