Messages in this thread Patch in this message | | | From | Jens Axboe <> | Subject | [PATCH 005/437] uio: add get/put_iter helpers | Date | Thu, 11 Apr 2024 09:12:25 -0600 |
| |
For users that currently do put_user(val, uaddr) or get_user(val, uaddr), add iterator versions that do the same thing.
Signed-off-by: Jens Axboe <axboe@kernel.dk> --- include/linux/uio.h | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/include/linux/uio.h b/include/linux/uio.h index 7020adedfa08..ed1711201597 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h @@ -215,6 +215,9 @@ bool copy_to_iter_full(const void *addr, size_t bytes, struct iov_iter *i) return false; } +#define put_iter(val, to) !copy_to_iter_full(&(val), sizeof((val)), to) +#define get_iter(val, from) !copy_from_iter_full(&(val), sizeof((val)), from) + static __always_inline __must_check bool copy_from_iter_full(void *addr, size_t bytes, struct iov_iter *i) { -- 2.43.0
| |