From: Pavel Begunkov Date: Sat, 5 Sep 2020 21:45:46 +0000 (+0300) Subject: io_uring: refactor io_req_map_rw() X-Git-Tag: baikal/mips/sdk5.9~12522^2~37 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=8ef73a0b4e3fb460aaaf95506af57ee194b9c7fd;p=kernel.git io_uring: refactor io_req_map_rw() Set rw->free_iovec to @iovec, that gives an identical result and stresses that @iovec param rw->free_iovec play the same role. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe --- diff --git a/fs/io_uring.c b/fs/io_uring.c index 6d8c2dcbfa081..bc7028d9e6f92 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3010,7 +3010,7 @@ static void io_req_map_rw(struct io_kiocb *req, const struct iovec *iovec, struct io_async_rw *rw = &req->io->rw; memcpy(&rw->iter, iter, sizeof(*iter)); - rw->free_iovec = NULL; + rw->free_iovec = iovec; rw->bytes_done = 0; /* can only be fixed buffers, no need to do anything */ if (iter->type == ITER_BVEC) @@ -3027,7 +3027,6 @@ static void io_req_map_rw(struct io_kiocb *req, const struct iovec *iovec, memcpy(rw->fast_iov + iov_off, fast_iov + iov_off, sizeof(struct iovec) * iter->nr_segs); } else { - rw->free_iovec = iovec; req->flags |= REQ_F_NEED_CLEANUP; } }