diff options
| author | Jens Axboe <[email protected]> | 2019-01-11 05:13:58 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2019-02-28 15:24:23 +0000 |
| commit | 6b06314c47e141031be043539900d80d2c7ba10f (patch) | |
| tree | a60db78dba6c690db3cbb1ea4d2fd7c3b9e9b127 /lib/error-inject.c | |
| parent | net: split out functions related to registering inflight socket files (diff) | |
| download | kernel-6b06314c47e141031be043539900d80d2c7ba10f.tar.gz kernel-6b06314c47e141031be043539900d80d2c7ba10f.zip | |
io_uring: add file set registration
We normally have to fget/fput for each IO we do on a file. Even with
the batching we do, the cost of the atomic inc/dec of the file usage
count adds up.
This adds IORING_REGISTER_FILES, and IORING_UNREGISTER_FILES opcodes
for the io_uring_register(2) system call. The arguments passed in must
be an array of __s32 holding file descriptors, and nr_args should hold
the number of file descriptors the application wishes to pin for the
duration of the io_uring instance (or until IORING_UNREGISTER_FILES is
called).
When used, the application must set IOSQE_FIXED_FILE in the sqe->flags
member. Then, instead of setting sqe->fd to the real fd, it sets sqe->fd
to the index in the array passed in to IORING_REGISTER_FILES.
Files are automatically unregistered when the io_uring instance is torn
down. An application need only unregister if it wishes to register a new
set of fds.
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'lib/error-inject.c')
0 files changed, 0 insertions, 0 deletions
