@@ -543,7 +543,7 @@ static void io_queue_iowq(struct io_kiocb *req)
543543 io_queue_linked_timeout (link );
544544}
545545
546- static void io_req_queue_iowq_tw (struct io_kiocb * req , struct io_tw_state * ts )
546+ static void io_req_queue_iowq_tw (struct io_kiocb * req , io_tw_token_t tw )
547547{
548548 io_queue_iowq (req );
549549}
@@ -1022,7 +1022,7 @@ static inline struct io_kiocb *io_req_find_next(struct io_kiocb *req)
10221022 return nxt ;
10231023}
10241024
1025- static void ctx_flush_and_put (struct io_ring_ctx * ctx , struct io_tw_state * ts )
1025+ static void ctx_flush_and_put (struct io_ring_ctx * ctx , io_tw_token_t tw )
10261026{
10271027 if (!ctx )
10281028 return ;
@@ -1277,7 +1277,7 @@ static bool io_run_local_work_continue(struct io_ring_ctx *ctx, int events,
12771277}
12781278
12791279static int __io_run_local_work_loop (struct llist_node * * node ,
1280- struct io_tw_state * ts ,
1280+ io_tw_token_t tw ,
12811281 int events )
12821282{
12831283 int ret = 0 ;
@@ -1288,7 +1288,7 @@ static int __io_run_local_work_loop(struct llist_node **node,
12881288 io_task_work .node );
12891289 INDIRECT_CALL_2 (req -> io_task_work .func ,
12901290 io_poll_task_func , io_req_rw_complete ,
1291- req , ts );
1291+ req , tw );
12921292 * node = next ;
12931293 if (++ ret >= events )
12941294 break ;
@@ -1297,7 +1297,7 @@ static int __io_run_local_work_loop(struct llist_node **node,
12971297 return ret ;
12981298}
12991299
1300- static int __io_run_local_work (struct io_ring_ctx * ctx , struct io_tw_state * ts ,
1300+ static int __io_run_local_work (struct io_ring_ctx * ctx , io_tw_token_t tw ,
13011301 int min_events , int max_events )
13021302{
13031303 struct llist_node * node ;
@@ -1310,7 +1310,7 @@ static int __io_run_local_work(struct io_ring_ctx *ctx, struct io_tw_state *ts,
13101310 atomic_andnot (IORING_SQ_TASKRUN , & ctx -> rings -> sq_flags );
13111311again :
13121312 min_events -= ret ;
1313- ret = __io_run_local_work_loop (& ctx -> retry_llist .first , ts , max_events );
1313+ ret = __io_run_local_work_loop (& ctx -> retry_llist .first , tw , max_events );
13141314 if (ctx -> retry_llist .first )
13151315 goto retry_done ;
13161316
@@ -1319,7 +1319,7 @@ static int __io_run_local_work(struct io_ring_ctx *ctx, struct io_tw_state *ts,
13191319 * running the pending items.
13201320 */
13211321 node = llist_reverse_order (llist_del_all (& ctx -> work_llist ));
1322- ret += __io_run_local_work_loop (& node , ts , max_events - ret );
1322+ ret += __io_run_local_work_loop (& node , tw , max_events - ret );
13231323 ctx -> retry_llist .first = node ;
13241324 loops ++ ;
13251325
@@ -1357,15 +1357,15 @@ static int io_run_local_work(struct io_ring_ctx *ctx, int min_events,
13571357 return ret ;
13581358}
13591359
1360- static void io_req_task_cancel (struct io_kiocb * req , struct io_tw_state * ts )
1360+ static void io_req_task_cancel (struct io_kiocb * req , io_tw_token_t tw )
13611361{
1362- io_tw_lock (req -> ctx , ts );
1362+ io_tw_lock (req -> ctx , tw );
13631363 io_req_defer_failed (req , req -> cqe .res );
13641364}
13651365
1366- void io_req_task_submit (struct io_kiocb * req , struct io_tw_state * ts )
1366+ void io_req_task_submit (struct io_kiocb * req , io_tw_token_t tw )
13671367{
1368- io_tw_lock (req -> ctx , ts );
1368+ io_tw_lock (req -> ctx , tw );
13691369 if (unlikely (io_should_terminate_tw ()))
13701370 io_req_defer_failed (req , - EFAULT );
13711371 else if (req -> flags & REQ_F_FORCE_ASYNC )
@@ -1583,7 +1583,7 @@ static int io_iopoll_check(struct io_ring_ctx *ctx, long min)
15831583 return 0 ;
15841584}
15851585
1586- void io_req_task_complete (struct io_kiocb * req , struct io_tw_state * ts )
1586+ void io_req_task_complete (struct io_kiocb * req , io_tw_token_t tw )
15871587{
15881588 io_req_complete_defer (req );
15891589}
@@ -1763,9 +1763,9 @@ static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)
17631763 return ret ;
17641764}
17651765
1766- int io_poll_issue (struct io_kiocb * req , struct io_tw_state * ts )
1766+ int io_poll_issue (struct io_kiocb * req , io_tw_token_t tw )
17671767{
1768- io_tw_lock (req -> ctx , ts );
1768+ io_tw_lock (req -> ctx , tw );
17691769 return io_issue_sqe (req , IO_URING_F_NONBLOCK |IO_URING_F_MULTISHOT |
17701770 IO_URING_F_COMPLETE_DEFER );
17711771}
0 commit comments