From c3bdad0271834214be01c1d687c262bf80da6eb0 Mon Sep 17 00:00:00 2001 From: Pavel Begunkov Date: Sun, 25 Apr 2021 14:32:22 +0100 Subject: io_uring: add generic rsrc update with tags Add IORING_REGISTER_RSRC_UPDATE, which also supports passing in rsrc tags. Implement it for registered files. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d4dc66df204212f64835ffca2c4eb5e8363f2f05.1619356238.git.asml.silence@gmail.com Signed-off-by: Jens Axboe --- include/uapi/linux/io_uring.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h index ce7b2fce6713..6d8360b5b9c5 100644 --- a/include/uapi/linux/io_uring.h +++ b/include/uapi/linux/io_uring.h @@ -299,6 +299,7 @@ enum { IORING_REGISTER_RESTRICTIONS = 11, IORING_REGISTER_ENABLE_RINGS = 12, IORING_REGISTER_RSRC = 13, + IORING_REGISTER_RSRC_UPDATE = 14, /* this goes last */ IORING_REGISTER_LAST @@ -311,12 +312,6 @@ struct io_uring_files_update { __aligned_u64 /* __s32 * */ fds; }; -struct io_uring_rsrc_update { - __u32 offset; - __u32 resv; - __aligned_u64 data; -}; - enum { IORING_RSRC_FILE = 0, }; @@ -328,6 +323,21 @@ struct io_uring_rsrc_register { __aligned_u64 tags; }; +struct io_uring_rsrc_update { + __u32 offset; + __u32 resv; + __aligned_u64 data; +}; + +struct io_uring_rsrc_update2 { + __u32 offset; + __u32 resv; + __aligned_u64 data; + __aligned_u64 tags; + __u32 type; + __u32 nr; +}; + /* Skip updating fd indexes set to this value in the fd table */ #define IORING_REGISTER_FILES_SKIP (-2) -- cgit