diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-10-03 13:59:56 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-10-29 10:22:44 -0600 |
commit | c3a31e605620c279163c14068a60869ea3fda203 (patch) | |
tree | 3d1f39bf1ab88bc2377c2da7682504b55f686c83 /include/uapi/linux/io_uring.h | |
parent | 08a451739a9b5783f67de51e84cb6d9559bb9dc4 (diff) | |
download | linux-stable-c3a31e605620c279163c14068a60869ea3fda203.tar.gz linux-stable-c3a31e605620c279163c14068a60869ea3fda203.tar.bz2 linux-stable-c3a31e605620c279163c14068a60869ea3fda203.zip |
io_uring: add support for IORING_REGISTER_FILES_UPDATE
Allows the application to remove/replace/add files to/from a file set.
Passes in a struct:
struct io_uring_files_update {
__u32 offset;
__s32 *fds;
};
that holds an array of fds, size of array passed in through the usual
nr_args part of the io_uring_register() system call. The logic is as
follows:
1) If ->fds[i] is -1, the existing file at i + ->offset is removed from
the set.
2) If ->fds[i] is a valid fd, the existing file at i + ->offset is
replaced with ->fds[i].
For case #2, is the existing file is currently empty (fd == -1), the
new fd is simply added to the array.
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/uapi/linux/io_uring.h')
-rw-r--r-- | include/uapi/linux/io_uring.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h index ea57526a5b89..4f532d9c0554 100644 --- a/include/uapi/linux/io_uring.h +++ b/include/uapi/linux/io_uring.h @@ -150,5 +150,11 @@ struct io_uring_params { #define IORING_UNREGISTER_FILES 3 #define IORING_REGISTER_EVENTFD 4 #define IORING_UNREGISTER_EVENTFD 5 +#define IORING_REGISTER_FILES_UPDATE 6 + +struct io_uring_files_update { + __u32 offset; + __s32 *fds; +}; #endif |