From d50f94d761a5d9a34e03a86e512e19d88cbeaf06 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 30 Oct 2024 09:51:58 -0600 Subject: io_uring/rsrc: get rid of the empty node and dummy_ubuf The empty node was used as a placeholder for a sparse entry, but it didn't really solve any issues. The caller still has to check for whether it's the empty node or not, it may as well just check for a NULL return instead. The dummy_ubuf was used for a sparse buffer entry, but NULL will serve the same purpose there of ensuring an -EFAULT on attempted import. Just use NULL for a sparse node, regardless of whether or not it's a file or buffer resource. Signed-off-by: Jens Axboe --- io_uring/io_uring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'io_uring/io_uring.c') diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 3a535e9e8ac3..44a772013c09 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -947,8 +947,8 @@ void io_req_defer_failed(struct io_kiocb *req, s32 res) static void io_preinit_req(struct io_kiocb *req, struct io_ring_ctx *ctx) { req->ctx = ctx; - req->rsrc_nodes[IORING_RSRC_FILE] = rsrc_empty_node; - req->rsrc_nodes[IORING_RSRC_BUFFER] = rsrc_empty_node; + req->rsrc_nodes[IORING_RSRC_FILE] = NULL; + req->rsrc_nodes[IORING_RSRC_BUFFER] = NULL; req->link = NULL; req->async_data = NULL; /* not necessary, but safer to zero */ -- cgit v1.2.3