Skip to content

Commit 5d70904

Browse files
isilenceaxboe
authored andcommitted
io_uring: inline io_poll_remove_waitqs
Inline io_poll_remove_waitqs() into its only user and clean it up. Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/2f1a91a19ffcd591531dc4c61e2f11c64a2d6a6d.1628536684.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 90f6736 commit 5d70904

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

fs/io_uring.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,6 @@ static void io_rsrc_put_work(struct work_struct *work);
10591059

10601060
static void io_req_task_queue(struct io_kiocb *req);
10611061
static void io_submit_flush_completions(struct io_ring_ctx *ctx);
1062-
static bool io_poll_remove_waitqs(struct io_kiocb *req);
10631062
static int io_req_prep_async(struct io_kiocb *req);
10641063

10651064
static struct kmem_cache *req_cachep;
@@ -5251,34 +5250,24 @@ static bool __io_poll_remove_one(struct io_kiocb *req,
52515250
return do_complete;
52525251
}
52535252

5254-
static bool io_poll_remove_waitqs(struct io_kiocb *req)
5253+
static bool io_poll_remove_one(struct io_kiocb *req)
52555254
__must_hold(&req->ctx->completion_lock)
52565255
{
5256+
int refs;
52575257
bool do_complete;
52585258

52595259
io_poll_remove_double(req);
52605260
do_complete = __io_poll_remove_one(req, io_poll_get_single(req), true);
52615261

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);
52755262
if (do_complete) {
52765263
io_cqring_fill_event(req->ctx, req->user_data, -ECANCELED, 0);
52775264
io_commit_cqring(req->ctx);
52785265
req_set_fail(req);
5279-
io_put_req_deferred(req, 1);
5280-
}
52815266

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+
}
52825271
return do_complete;
52835272
}
52845273

0 commit comments

Comments
 (0)