Skip to content

Commit

Permalink
io_uring: code clean for some ctx usage
Browse files Browse the repository at this point in the history
There are some functions doing ctx = req->ctx while still using
req->ctx, update those places.

Signed-off-by: Hao Xu <haoxu@linux.alibaba.com>
Link: https://lore.kernel.org/r/20211214055904.61772-1-haoxu@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Hao Xu authored and Jens Axboe committed Dec 14, 2021
1 parent f28c240 commit 33ce2af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,7 @@ static void io_prep_async_link(struct io_kiocb *req)
static inline void io_req_add_compl_list(struct io_kiocb *req)
{
struct io_ring_ctx *ctx = req->ctx;
struct io_submit_state *state = &req->ctx->submit_state;
struct io_submit_state *state = &ctx->submit_state;

if (!(req->flags & REQ_F_CQE_SKIP))
ctx->submit_state.flush_cqes = true;
Expand Down Expand Up @@ -2188,7 +2188,7 @@ static void __io_req_find_next_prep(struct io_kiocb *req)
spin_lock(&ctx->completion_lock);
posted = io_disarm_next(req);
if (posted)
io_commit_cqring(req->ctx);
io_commit_cqring(ctx);
spin_unlock(&ctx->completion_lock);
if (posted)
io_cqring_ev_posted(ctx);
Expand Down

0 comments on commit 33ce2af

Please sign in to comment.