diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-10-26 18:41:51 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-11-02 22:44:30 +0100 |
commit | 0701db7439208951c8a7d8600668e5cfdd5f63d2 (patch) | |
tree | da619885e5375a534c829a3ca613e8e0b9320060 /io_uring/notif.c | |
parent | io_uring/rsrc: get rid of io_rsrc_node allocation cache (diff) | |
download | linux-0701db7439208951c8a7d8600668e5cfdd5f63d2.tar.xz linux-0701db7439208951c8a7d8600668e5cfdd5f63d2.zip |
io_uring/rsrc: add an empty io_rsrc_node for sparse buffer entries
Rather than allocate an io_rsrc_node for an empty/sparse buffer entry,
add a const entry that can be used for that. This just needs checking
for writing the tag, and the put check needs to check for that sparse
node rather than NULL for validity.
This avoids allocating rsrc nodes for sparse buffer entries.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/notif.c')
-rw-r--r-- | io_uring/notif.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/io_uring/notif.c b/io_uring/notif.c index 4f02e969cf08..44bf21c0f810 100644 --- a/io_uring/notif.c +++ b/io_uring/notif.c @@ -117,8 +117,8 @@ struct io_kiocb *io_alloc_notif(struct io_ring_ctx *ctx) notif->file = NULL; notif->task = current; io_get_task_refs(1); - notif->rsrc_nodes[IORING_RSRC_FILE] = NULL; - notif->rsrc_nodes[IORING_RSRC_BUFFER] = NULL; + notif->rsrc_nodes[IORING_RSRC_FILE] = rsrc_empty_node; + notif->rsrc_nodes[IORING_RSRC_BUFFER] = rsrc_empty_node; nd = io_notif_to_data(notif); nd->zc_report = false; |