iov_iter: add iter_iov_addr() and iter_iov_len() helpers

These just return the address and length of the current iovec segment
in the iterator. Convert existing iov_iter_iovec() users to use them
instead of getting a copy of the current vec.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe
2023-03-29 09:16:45 -06:00
parent e4d3202c18
commit 95e49cf837
4 changed files with 24 additions and 25 deletions

View File

@@ -70,6 +70,8 @@ struct iov_iter {
};
#define iter_iov(iter) (iter)->__iov
#define iter_iov_addr(iter) (iter_iov(iter)->iov_base + (iter)->iov_offset)
#define iter_iov_len(iter) (iter_iov(iter)->iov_len - (iter)->iov_offset)
static inline enum iter_type iov_iter_type(const struct iov_iter *i)
{