io_uring: allow allocated fixed files for openat/openat2
authorJens Axboe <axboe@kernel.dk>
Sat, 7 May 2022 20:18:44 +0000 (14:18 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 May 2022 15:09:08 +0000 (09:09 -0600)
commit08cf52bc6eb44e72c3bc507d0d8bcf1b50270aa0
treef4801a245ebb66c704d47ce2f4777f0338c2a65f
parentc18a56320ad39d72a5d8033a5e8126b437cf63bc
io_uring: allow allocated fixed files for openat/openat2

If the application passes in IORING_FILE_INDEX_ALLOC as the file_slot,
then that's a hint to allocate a fixed file descriptor rather than have
one be passed in directly.

This can be useful for having io_uring manage the direct descriptor space.

Normal open direct requests will complete with 0 for success, and < 0
in case of error. If io_uring is asked to allocated the direct descriptor,
then the direct descriptor is returned in case of success.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
include/uapi/linux/io_uring.h