Skip to content

Commit

Permalink
io_uring: refactor timeout cancellation cqe posting
Browse files Browse the repository at this point in the history
io_fill_cqe*() is not always the best way to post CQEs just because
there is enough of infrastructure on top. Replace a raw call to a
variant of it inside of io_timeout_cancel(), which also saves us some
bloating and might help with batching later.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/46113ec4345764b4aef3b384ce38cceabaeedcbb.1647481208.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Pavel Begunkov authored and Jens Axboe committed Mar 17, 2022
1 parent ae4da18 commit 6695490
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -6471,10 +6471,7 @@ static int io_timeout_cancel(struct io_ring_ctx *ctx, __u64 user_data)

if (IS_ERR(req))
return PTR_ERR(req);

req_set_fail(req);
io_fill_cqe_req(req, -ECANCELED, 0);
io_put_req_deferred(req);
io_req_task_queue_fail(req, -ECANCELED);
return 0;
}

Expand Down

0 comments on commit 6695490

Please sign in to comment.