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 12:29:53 +0000 (06:29 -0600)
commit0db0570a9f51b75693b0e9c7553be004521abceb
tree7426b81dbacf9a1e69145cc8204f325d3554a0e5
parent26e6b1abf6c6c7e142f183940f754bab69b76a05
io_uring: allow allocated fixed files for openat/openat2

If the applications passes in UINT_MAX 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