From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 07/10] io_uring: clean up req->result setting by rw
Date: Sun, 28 Jun 2020 12:52:35 +0300 [thread overview]
Message-ID: <3b244ef0940e172f51b411275453eb76f13d720e.1593337097.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
Assign req->result to io_size early in io_{read,write}(),
it's enough and makes it more straightforward.
Signed-off-by: Pavel Begunkov <[email protected]>
---
fs/io_uring.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index b9f44c6b32f1..5e0196393c4f 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2384,7 +2384,6 @@ static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe,
kiocb->ki_flags |= IOCB_HIPRI;
kiocb->ki_complete = io_complete_rw_iopoll;
- req->result = 0;
req->iopoll_completed = 0;
} else {
if (kiocb->ki_flags & IOCB_HIPRI)
@@ -2957,10 +2956,8 @@ static int io_read(struct io_kiocb *req, bool force_nonblock,
if (!force_nonblock)
kiocb->ki_flags &= ~IOCB_NOWAIT;
- req->result = 0;
io_size = ret;
- if (req->flags & REQ_F_LINK_HEAD)
- req->result = io_size;
+ req->result = io_size;
/* If the file doesn't support async, just async punt */
if (force_nonblock && !io_file_supports_async(req->file, READ))
@@ -3054,10 +3051,8 @@ static int io_write(struct io_kiocb *req, bool force_nonblock,
if (!force_nonblock)
req->rw.kiocb.ki_flags &= ~IOCB_NOWAIT;
- req->result = 0;
io_size = ret;
- if (req->flags & REQ_F_LINK_HEAD)
- req->result = io_size;
+ req->result = io_size;
/* If the file doesn't support async, just async punt */
if (force_nonblock && !io_file_supports_async(req->file, WRITE))
--
2.24.0
next prev parent reply other threads:[~2020-06-28 9:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-28 9:52 [PATCH 00/10] some fixing + refactoring batch-free Pavel Begunkov
2020-06-28 9:52 ` [PATCH 01/10] io_uring: fix refs underflow in io_iopoll_queue() Pavel Begunkov
2020-06-28 9:52 ` [PATCH 02/10] io_uring: remove inflight batching in free_many() Pavel Begunkov
2020-06-28 9:52 ` [PATCH 03/10] io_uring: dismantle req early and remove need_iter Pavel Begunkov
2020-06-28 9:52 ` [PATCH 04/10] io_uring: batch-free linked reqs as well Pavel Begunkov
2020-06-28 9:52 ` [PATCH 05/10] io_uring: cosmetic changes for batch free Pavel Begunkov
2020-06-28 9:52 ` [PATCH 06/10] io_uring: kill REQ_F_LINK_NEXT Pavel Begunkov
2020-06-28 9:52 ` Pavel Begunkov [this message]
2020-06-28 9:52 ` [PATCH 08/10] io_uring: fix missing wake_up io_rw_reissue() Pavel Begunkov
2020-06-28 14:12 ` Jens Axboe
2020-06-28 14:48 ` Pavel Begunkov
2020-06-28 9:52 ` [PATCH 09/10] io_uring: do task_work_run() during iopoll Pavel Begunkov
2020-06-28 9:52 ` [PATCH 10/10] io_uring: fix iopoll -EAGAIN handling Pavel Begunkov
2020-06-28 14:09 ` [PATCH 00/10] some fixing + refactoring batch-free 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=3b244ef0940e172f51b411275453eb76f13d720e.1593337097.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