From: Jens Axboe <axboe@kernel.dk>
To: io-uring@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>
Subject: [PATCH 2/4] io_uring/rw: get rid of using req->imu
Date: Mon, 21 Oct 2024 20:03:21 -0600 [thread overview]
Message-ID: <20241022020426.819298-3-axboe@kernel.dk> (raw)
In-Reply-To: <20241022020426.819298-1-axboe@kernel.dk>
It's assigned in the same function that it's being used, get rid of
it. A local variable will do just fine.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
io_uring/rw.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/io_uring/rw.c b/io_uring/rw.c
index 80ae3c2ebb70..c633365aa37d 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -330,6 +330,7 @@ static int io_prep_rw_fixed(struct io_kiocb *req, const struct io_uring_sqe *sqe
{
struct io_rw *rw = io_kiocb_to_cmd(req, struct io_rw);
struct io_ring_ctx *ctx = req->ctx;
+ struct io_mapped_ubuf *imu;
struct io_async_rw *io;
u16 index;
int ret;
@@ -341,11 +342,11 @@ static int io_prep_rw_fixed(struct io_kiocb *req, const struct io_uring_sqe *sqe
if (unlikely(req->buf_index >= ctx->nr_user_bufs))
return -EFAULT;
index = array_index_nospec(req->buf_index, ctx->nr_user_bufs);
- req->imu = ctx->user_bufs[index];
+ imu = ctx->user_bufs[index];
io_req_set_rsrc_node(req, ctx, 0);
io = req->async_data;
- ret = io_import_fixed(ddir, &io->iter, req->imu, rw->addr, rw->len);
+ ret = io_import_fixed(ddir, &io->iter, imu, rw->addr, rw->len);
iov_iter_save_state(&io->iter, &io->iter_state);
return ret;
}
--
2.45.2
next prev parent reply other threads:[~2024-10-22 2:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 2:03 [PATCHSET v2 for-next 0/4] Get rid of io_kiocb->imu Jens Axboe
2024-10-22 2:03 ` [PATCH 1/4] io_uring/uring_cmd: get rid of using req->imu Jens Axboe
2024-10-22 2:43 ` Ming Lei
2024-10-22 2:59 ` Jens Axboe
2024-10-22 8:34 ` Anuj Gupta
2024-10-22 13:18 ` Jens Axboe
2024-10-22 13:24 ` Jens Axboe
2024-10-22 2:03 ` Jens Axboe [this message]
2024-10-22 2:03 ` [PATCH 3/4] io_uring/net: move send zc fixed buffer import to issue path Jens Axboe
2024-10-22 2:03 ` [PATCH 4/4] io_uring: kill 'imu' from struct io_kiocb Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2024-10-22 13:32 [PATCHSET v3 for-next 0/4] Get rid of io_kiocb->imu Jens Axboe
2024-10-22 13:32 ` [PATCH 2/4] io_uring/rw: get rid of using req->imu Jens Axboe
2024-10-18 18:38 [PATCHSET for-next 0/4] Get rid of io_kiocb->imu Jens Axboe
2024-10-18 18:38 ` [PATCH 2/4] io_uring/rw: get rid of using req->imu 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=20241022020426.819298-3-axboe@kernel.dk \
--to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox