io_uring: Add skip option for __io_sqe_files_update
PATCH 1/1 io_uring: Add skip option for __io_sqe_files_update
This patch adds support for skipping a file descriptor when using IORING_REGISTER_FILES_UPDATE. __io_sqe_files_update will skip fds set to IORING_REGISTER_FILES_SKIP. IORING_REGISTER_FILES_SKIP is inturn added as a #define in io_uring.h
Signed-off-by noah <[email protected]>
---
Supporting documentation and tests in liburing can be added in PR284
(https://github.com/axboe/liburing/pull/284) if this patch is applied.
fs/io_uring.c | 3 +++ include/uapi/linux/io_uring.h | 7 +++++++ 2 files changed, 10 insertions(+)
fs/io_uring.c +3 -0
@@ -8039,6 +8039,9 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx, err = -EFAULT ;break ; } +if (fd ==IORING_REGISTER_FILES_SKIP ) +continue ; + i =array_index_nospec (up->offset + done, ctx->nr_user_files); table = &ctx->file_data->table[i >>IORING_FILE_TABLE_SHIFT ]; index = i &IORING_FILE_TABLE_MASK ;
include/uapi/linux/io_uring.h +7 -0
@@ -298,6 +298,13 @@ struct io_uring_rsrc_update {__aligned_u64 data; }; +/* +* fd value in *((__s32 *)io_uring_rsrc_update->data) +*/ + +/* Skip updating fd indexes set to this value */ +#define IORING_REGISTER_FILES_SKIP (-2) +#define IO_URING_OP_SUPPORTED (1U << 0)struct io_uring_probe_op {
Signature · 1 line
2.29.2
A message that is not in the archive (sent off-list or not yet received): CAFUsyfLChkYYjBBtkcAErqrs3XaZ80zaPCB3Qn3rWPYTDd88Mg@mail.gmail.com
Jens Axboe
maintainerQuoted 1 line · Noah Goldstein
Ping
It's already in.
Signature · 1 line
Jens Axboe