summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2020-09-06 00:45:45 +0300
committerJens Axboe <axboe@kernel.dk>2020-09-30 20:32:33 -0600
commitf4bff104fffba2f069bc1b19ef0decbca7ff5459 (patch)
treec5ebb893156a62c5d6f91819bfea47d2aad07e4e
parent90554200724d5b280439dc361fe7ee92fe459ea7 (diff)
io_uring: simplify io_rw_prep_async()
Don't touch iter->iov and iov in between __io_import_iovec() and io_req_map_rw(), the former function aleady sets it correctly, because it creates one more case with NULL'ed iov to consider in io_req_map_rw(). Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--fs/io_uring.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 3ee6ee1785d2..6d8c2dcbfa08 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3065,16 +3065,14 @@ static inline int io_rw_prep_async(struct io_kiocb *req, int rw,
bool force_nonblock)
{
struct io_async_rw *iorw = &req->io->rw;
- struct iovec *iov;
+ struct iovec *iov = iorw->fast_iov;
ssize_t ret;
- iorw->iter.iov = iov = iorw->fast_iov;
ret = __io_import_iovec(rw, req, &iov, &iorw->iter, !force_nonblock);
if (unlikely(ret < 0))
return ret;
- iorw->iter.iov = iov;
- io_req_map_rw(req, iorw->iter.iov, iorw->fast_iov, &iorw->iter);
+ io_req_map_rw(req, iov, iorw->fast_iov, &iorw->iter);
return 0;
}