summaryrefslogtreecommitdiff
path: root/include/linux/uio.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-03-29 09:16:45 -0600
committerJens Axboe <axboe@kernel.dk>2023-03-30 08:12:29 -0600
commit95e49cf8373a0a4d1ec85f0512080bb4f945df74 (patch)
treea4fb24a611ed5d3357a785dc7f561981d379a620 /include/linux/uio.h
parente4d3202c18329ba2733c9e04489b6ef05d3bce08 (diff)
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>
Diffstat (limited to 'include/linux/uio.h')
-rw-r--r--include/linux/uio.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/uio.h b/include/linux/uio.h
index 4218624b7f78..b7fce87b720e 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -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)
{