All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Subject: [PATCH 2/6] io_uring: deduplicate __io_complete_rw()
Date: Thu, 30 Jul 2020 18:43:46 +0300	[thread overview]
Message-ID: <571f3037d6b7fa885dc075e56224cafcdfd68eaf.1596123376.git.asml.silence@gmail.com> (raw)
In-Reply-To: <cover.1596123376.git.asml.silence@gmail.com>

Call __io_complete_rw() in io_iopoll_queue() instead of hand coding it.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 fs/io_uring.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 86ec5669fe50..11f4ab87e08f 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -891,7 +891,8 @@ enum io_mem_account {
 	ACCT_PINNED,
 };
 
-static bool io_rw_reissue(struct io_kiocb *req, long res);
+static void __io_complete_rw(struct io_kiocb *req, long res, long res2,
+			     struct io_comp_state *cs);
 static void io_cqring_fill_event(struct io_kiocb *req, long res);
 static void io_put_req(struct io_kiocb *req);
 static void io_double_put_req(struct io_kiocb *req);
@@ -902,8 +903,6 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
 				 struct io_uring_files_update *ip,
 				 unsigned nr_args);
 static int io_prep_work_files(struct io_kiocb *req);
-static void io_complete_rw_common(struct kiocb *kiocb, long res,
-				  struct io_comp_state *cs);
 static void __io_clean_op(struct io_kiocb *req);
 static int io_file_get(struct io_submit_state *state, struct io_kiocb *req,
 		       int fd, struct file **out_file, bool fixed);
@@ -1976,8 +1975,7 @@ static void io_iopoll_queue(struct list_head *again)
 	do {
 		req = list_first_entry(again, struct io_kiocb, inflight_entry);
 		list_del(&req->inflight_entry);
-		if (!io_rw_reissue(req, -EAGAIN))
-			io_complete_rw_common(&req->rw.kiocb, -EAGAIN, NULL);
+		__io_complete_rw(req, -EAGAIN, 0, NULL);
 	} while (!list_empty(again));
 }
 
-- 
2.24.0


  parent reply	other threads:[~2020-07-30 15:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30 15:43 [PATCH 0/6] 5.9 small cleanups/fixes Pavel Begunkov
2020-07-30 15:43 ` [PATCH 1/6] io_uring: de-unionise io_kiocb Pavel Begunkov
2020-07-30 15:43 ` Pavel Begunkov [this message]
2020-07-30 15:43 ` [PATCH 3/6] io_uring: fix racy overflow count reporting Pavel Begunkov
2020-07-30 17:18   ` Jens Axboe
2020-07-30 17:33     ` Pavel Begunkov
2020-07-30 17:41       ` Jens Axboe
2020-07-30 15:43 ` [PATCH 4/6] io_uring: fix stalled deferred requests Pavel Begunkov
2020-07-30 15:43 ` [PATCH 5/6] io_uring: consolidate *_check_overflow accounting Pavel Begunkov
2020-07-30 15:43 ` [PATCH 6/6] io_uring: get rid of atomic FAA for cq_timeouts Pavel Begunkov
2020-07-30 18:08 ` [PATCH 0/6] 5.9 small cleanups/fixes Jens Axboe
2020-07-31 14:28   ` Pavel Begunkov
2020-07-31 15:10     ` 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=571f3037d6b7fa885dc075e56224cafcdfd68eaf.1596123376.git.asml.silence@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.