public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 4/5] io_uring: refactor io_req_add_compl_list()
Date: Fri, 25 Mar 2022 11:52:17 +0000	[thread overview]
Message-ID: <f0a5272b45efe4ffc41cb79b99784e39c699aade.1648209006.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

A small refactoring for io_req_add_compl_list() deduplicating some code.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index e651a0bb00fe..9cd33278089b 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1726,11 +1726,10 @@ 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 = &ctx->submit_state;
+	struct io_submit_state *state = &req->ctx->submit_state;
 
 	if (!(req->flags & REQ_F_CQE_SKIP))
-		ctx->submit_state.flush_cqes = true;
+		state->flush_cqes = true;
 	wq_list_add_tail(&req->comp_list, &state->compl_reqs);
 }
 
-- 
2.35.1


  parent reply	other threads:[~2022-03-25 11:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 11:52 [PATCH 0/5] small for-next cleanups Pavel Begunkov
2022-03-25 11:52 ` [PATCH 1/5] io_uring: cleanup conditional submit locking Pavel Begunkov
2022-03-25 11:52 ` [PATCH 2/5] io_uring: partially uninline io_put_task() Pavel Begunkov
2022-03-25 11:52 ` [PATCH 3/5] io_uring: silence io_for_each_link() warning Pavel Begunkov
2022-03-25 12:35   ` Jens Axboe
2022-03-25 11:52 ` Pavel Begunkov [this message]
2022-03-25 11:52 ` [PATCH 5/5] io_uring: improve req fields comments Pavel Begunkov
2022-03-25 12:37   ` Jens Axboe
2022-03-25 12:38 ` (subset) [PATCH 0/5] small for-next cleanups Jens Axboe
2022-03-25 12:39 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f0a5272b45efe4ffc41cb79b99784e39c699aade.1648209006.git.asml.silence@gmail.com \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox