public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: code clean for some ctx usage
@ 2021-12-14  5:59 Hao Xu
  2021-12-14 13:49 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Hao Xu @ 2021-12-14  5:59 UTC (permalink / raw)
  To: Jens Axboe; +Cc: io-uring, Pavel Begunkov, Joseph Qi

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

Signed-off-by: Hao Xu <[email protected]>
---
 fs/io_uring.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 1265dc1942eb..d86372664f9f 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] io_uring: code clean for some ctx usage
  2021-12-14  5:59 [PATCH] io_uring: code clean for some ctx usage Hao Xu
@ 2021-12-14 13:49 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-12-14 13:49 UTC (permalink / raw)
  To: Hao Xu; +Cc: Pavel Begunkov, io-uring, Joseph Qi

On Tue, 14 Dec 2021 13:59:04 +0800, Hao Xu wrote:
> 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,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-14 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-14  5:59 [PATCH] io_uring: code clean for some ctx usage Hao Xu
2021-12-14 13:49 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox