diff options
author | Jens Axboe <axboe@kernel.dk> | 2023-03-29 08:52:15 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-03-30 08:12:29 -0600 |
commit | de4f5fed3f231a8ff4790bf52975f847b95b85ea (patch) | |
tree | 0f546e08dadb0145ca9347ce3fc2b8936d48c5f6 /io_uring/net.c | |
parent | 0a2481cde24f78f503cbc066df2c9c160e64cfd6 (diff) | |
download | linux-de4f5fed3f231a8ff4790bf52975f847b95b85ea.tar.gz linux-de4f5fed3f231a8ff4790bf52975f847b95b85ea.tar.bz2 linux-de4f5fed3f231a8ff4790bf52975f847b95b85ea.zip |
iov_iter: add iter_iovec() helper
This returns a pointer to the current iovec entry in the iterator. Only
useful with ITER_IOVEC right now, but it prepares us to treat ITER_UBUF
and ITER_IOVEC identically for the first segment.
Rename struct iov_iter->iov to iov_iter->__iov to find any potentially
troublesome spots, and also to prevent anyone from adding new code that
accesses iter->iov directly.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/net.c')
-rw-r--r-- | io_uring/net.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/io_uring/net.c b/io_uring/net.c index 4040cf093318..89e839013837 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -184,8 +184,8 @@ static int io_setup_async_msg(struct io_kiocb *req, async_msg->msg.msg_name = &async_msg->addr; /* if were using fast_iov, set it to the new one */ if (iter_is_iovec(&kmsg->msg.msg_iter) && !kmsg->free_iov) { - size_t fast_idx = kmsg->msg.msg_iter.iov - kmsg->fast_iov; - async_msg->msg.msg_iter.iov = &async_msg->fast_iov[fast_idx]; + size_t fast_idx = iter_iov(&kmsg->msg.msg_iter) - kmsg->fast_iov; + async_msg->msg.msg_iter.__iov = &async_msg->fast_iov[fast_idx]; } return -EAGAIN; |