mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
io_uring: introduce struct iou_vec
I need a convenient way to pass around and work with iovec+size pair, put them into a structure and makes use of it in rw.c Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/d39fadafc9e9047b0a292e5be6db3cf2f48bb1f7.1741362889.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
6e3da40ed6
commit
e1d4995909
@@ -145,4 +145,20 @@ static inline void __io_unaccount_mem(struct user_struct *user,
|
||||
atomic_long_sub(nr_pages, &user->locked_vm);
|
||||
}
|
||||
|
||||
void io_vec_free(struct iou_vec *iv);
|
||||
|
||||
static inline void io_vec_reset_iovec(struct iou_vec *iv,
|
||||
struct iovec *iovec, unsigned nr)
|
||||
{
|
||||
io_vec_free(iv);
|
||||
iv->iovec = iovec;
|
||||
iv->nr = nr;
|
||||
}
|
||||
|
||||
static inline void io_alloc_cache_vec_kasan(struct iou_vec *iv)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_KASAN))
|
||||
io_vec_free(iv);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user