Skip to contentSkip to conversation

io_uring: code clean for some ctx usage

PATCH Applied Hao Xu 2 participants 2 messages Dec 14, 2021

Subsystems (2)
lore
Share & tools
lore

Hao Xu

author
#0 lore raw

PATCH 1/1 io_uring: code clean for some ctx usage

There are some functions doing ctx = req->ctx while still using req->ctx, update those places.

---
 fs/io_uring.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/io_uring.c +2 -2
index 1265dc1942eb..d86372664f9f 100644
@@ -1548,7 +1548,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;
@@ -2179,7 +2179,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);
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Hao Xu

There are some functions doing ctx = req->ctx while still using req->ctx, update those places.

Applied, thanks!

[1/1] io_uring: code clean for some ctx usage

      commit: 33ce2aff7d340bf48875ccd80628c884cf8017ae

Best regards,

Signature · 1 line
Jens Axboe