summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authornoah <goldstein.w.n@gmail.com>2021-01-26 15:23:28 -0500
committerJens Axboe <axboe@kernel.dk>2021-02-01 10:02:43 -0700
commit4e0377a1c5c633852f443a562ec55f7dfea65350 (patch)
treeda82d3cfe9c6b612d7e0bacc32408ca7c9816634 /fs
parent67973b933e347c38478b591d6c9dc076bea7c9dc (diff)
downloadlinux-stable-4e0377a1c5c633852f443a562ec55f7dfea65350.tar.gz
linux-stable-4e0377a1c5c633852f443a562ec55f7dfea65350.tar.bz2
linux-stable-4e0377a1c5c633852f443a562ec55f7dfea65350.zip
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 <goldstein.w.n@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r--fs/io_uring.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 0ca99bd5c316..dd83a64ba709 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8038,6 +8038,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;