On 5/9/22 10:44 PM, Hao Xu wrote: >> @@ -11931,6 +11937,9 @@ static int __io_uring_register(struct io_ring_ctx *ctx, unsigned opcode, >> ret = io_sqe_buffers_unregister(ctx); >> break; >> case IORING_REGISTER_FILES: >> + ret = -EFAULT; >> + if (!arg) >> + break; >> ret = io_sqe_files_register(ctx, arg, nr_args, NULL); >> break; >> case IORING_UNREGISTER_FILES: >> diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h >> index b7f02a55032a..d09cf7c0d1fe 100644 >> --- a/include/uapi/linux/io_uring.h >> +++ b/include/uapi/linux/io_uring.h >> @@ -396,9 +396,15 @@ struct io_uring_files_update { >> __aligned_u64 /* __s32 * */ fds; >> }; >> +/* >> + * Register a fully sparse file sparse, rather than pass in an array of all > > ^space Thanks, fixed. >> + * -1 file descriptors. >> + */ >> +#define IORING_RSRC_REGISTER_SPARSE (1U << 0) >> + >> struct io_uring_rsrc_register { >> __u32 nr; >> - __u32 resv; >> + __u32 flags; >> __u64 resv2; >> __aligned_u64 data; >> __aligned_u64 tags; > > This looks promising, we may eliminate cqes for open/accept_direct reqs. > > feel free to add, > Reviewed-by: Hao Xu <howeyxu@xxxxxxxxxxx> Added, thanks. Did you review the other ones too? -- Jens Axboe