io_uring: allow allocated fixed files for accept fastpoll-mshot
authorJens Axboe <axboe@kernel.dk>
Sat, 7 May 2022 16:08:31 +0000 (10:08 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 May 2022 12:29:53 +0000 (06:29 -0600)
commite721cdc172fd3aa845e4a0850cb5f9aefd8f3591
treed86a2e4f2bb9176b2d1b276af3785e89c158d487
parent0db0570a9f51b75693b0e9c7553be004521abceb
io_uring: allow allocated fixed files for accept

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,
and also allows multi-shot support to work with fixed files.

Normal accept 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