Skip to content

Commit dd221f4

Browse files
isilenceaxboe
authored andcommitted
io_uring: inline io_poll_task_handler()
io_poll_task_handler() doesn't add clarity, inline it in its only user. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 069b893 commit dd221f4

1 file changed

Lines changed: 12 additions & 19 deletions

File tree

fs/io_uring.c

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4925,32 +4925,25 @@ static void io_poll_complete(struct io_kiocb *req, __poll_t mask, int error)
49254925
io_commit_cqring(ctx);
49264926
}
49274927

4928-
static void io_poll_task_handler(struct io_kiocb *req, struct io_kiocb **nxt)
4928+
static void io_poll_task_func(struct callback_head *cb)
49294929
{
4930+
struct io_kiocb *req = container_of(cb, struct io_kiocb, task_work);
49304931
struct io_ring_ctx *ctx = req->ctx;
4932+
struct io_kiocb *nxt;
49314933

49324934
if (io_poll_rewait(req, &req->poll)) {
49334935
spin_unlock_irq(&ctx->completion_lock);
4934-
return;
4935-
}
4936-
4937-
hash_del(&req->hash_node);
4938-
io_poll_complete(req, req->result, 0);
4939-
spin_unlock_irq(&ctx->completion_lock);
4940-
4941-
*nxt = io_put_req_find_next(req);
4942-
io_cqring_ev_posted(ctx);
4943-
}
4936+
} else {
4937+
hash_del(&req->hash_node);
4938+
io_poll_complete(req, req->result, 0);
4939+
spin_unlock_irq(&ctx->completion_lock);
49444940

4945-
static void io_poll_task_func(struct callback_head *cb)
4946-
{
4947-
struct io_kiocb *req = container_of(cb, struct io_kiocb, task_work);
4948-
struct io_ring_ctx *ctx = req->ctx;
4949-
struct io_kiocb *nxt = NULL;
4941+
nxt = io_put_req_find_next(req);
4942+
io_cqring_ev_posted(ctx);
4943+
if (nxt)
4944+
__io_req_task_submit(nxt);
4945+
}
49504946

4951-
io_poll_task_handler(req, &nxt);
4952-
if (nxt)
4953-
__io_req_task_submit(nxt);
49544947
percpu_ref_put(&ctx->refs);
49554948
}
49564949

0 commit comments

Comments
 (0)