@@ -1059,7 +1059,6 @@ static void io_rsrc_put_work(struct work_struct *work);
1059
1059
1060
1060
static void io_req_task_queue (struct io_kiocb * req );
1061
1061
static void io_submit_flush_completions (struct io_ring_ctx * ctx );
1062
- static bool io_poll_remove_waitqs (struct io_kiocb * req );
1063
1062
static int io_req_prep_async (struct io_kiocb * req );
1064
1063
1065
1064
static struct kmem_cache * req_cachep ;
@@ -5251,34 +5250,24 @@ static bool __io_poll_remove_one(struct io_kiocb *req,
5251
5250
return do_complete ;
5252
5251
}
5253
5252
5254
- static bool io_poll_remove_waitqs (struct io_kiocb * req )
5253
+ static bool io_poll_remove_one (struct io_kiocb * req )
5255
5254
__must_hold (& req - > ctx - > completion_lock )
5256
5255
{
5256
+ int refs ;
5257
5257
bool do_complete ;
5258
5258
5259
5259
io_poll_remove_double (req );
5260
5260
do_complete = __io_poll_remove_one (req , io_poll_get_single (req ), true);
5261
5261
5262
- if (req -> opcode != IORING_OP_POLL_ADD && do_complete ) {
5263
- /* non-poll requests have submit ref still */
5264
- req_ref_put (req );
5265
- }
5266
- return do_complete ;
5267
- }
5268
-
5269
- static bool io_poll_remove_one (struct io_kiocb * req )
5270
- __must_hold (& req - > ctx - > completion_lock )
5271
- {
5272
- bool do_complete ;
5273
-
5274
- do_complete = io_poll_remove_waitqs (req );
5275
5262
if (do_complete ) {
5276
5263
io_cqring_fill_event (req -> ctx , req -> user_data , - ECANCELED , 0 );
5277
5264
io_commit_cqring (req -> ctx );
5278
5265
req_set_fail (req );
5279
- io_put_req_deferred (req , 1 );
5280
- }
5281
5266
5267
+ /* non-poll requests have submit ref still */
5268
+ refs = 1 + (req -> opcode != IORING_OP_POLL_ADD );
5269
+ io_put_req_deferred (req , refs );
5270
+ }
5282
5271
return do_complete ;
5283
5272
}
5284
5273
0 commit comments