io_uring: add flag for allocating a fully sparse direct descriptor space for-5.19/io_uring-fixed-alloc
authorJens Axboe <axboe@kernel.dk>
Mon, 9 May 2022 15:29:14 +0000 (09:29 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 10 May 2022 12:28:17 +0000 (06:28 -0600)
commit83549c0e2c481cc1565ed9ede1b108a3b1a34cfb
tree6103abe23827c5e6d853ff67bc71cd93b1b460a5
parent5dd977985f24052b6288e14d75dac4600ee69e0c
io_uring: add flag for allocating a fully sparse direct descriptor space

Currently to setup a fully sparse descriptor space upfront, the app needs
to alloate an array of the full size and memset it to -1 and then pass
that in. Make this a bit easier by allowing a flag that simply does
this internally rather than needing to copy each slot separately.

This works with IORING_REGISTER_FILES2 as the flag is set in struct
io_uring_rsrc_register, and is only allow when the type is
IORING_RSRC_FILE as this doesn't make sense for registered buffers.

Reviewed-by: Hao Xu <howeyxu@tencent.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
include/uapi/linux/io_uring.h