]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
io_uring/msg_ring: Drop custom destructor
authorGabriel Krisman Bertazi <krisman@suse.de>
Mon, 16 Dec 2024 20:46:15 +0000 (15:46 -0500)
committerJens Axboe <axboe@kernel.dk>
Fri, 27 Dec 2024 17:08:21 +0000 (10:08 -0700)
kfree can handle slab objects nowadays. Drop the extra callback and just
use kfree.

Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
Link: https://lore.kernel.org/r/20241216204615.759089-10-krisman@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c
io_uring/msg_ring.c
io_uring/msg_ring.h

index e6d12104f8cb0fdc3610d3e8a8149ccdee67ae3e..42d4cc5da73b68583de171b2b9f7d1be73a35632 100644 (file)
@@ -361,7 +361,7 @@ err:
        io_alloc_cache_free(&ctx->netmsg_cache, io_netmsg_cache_free);
        io_alloc_cache_free(&ctx->rw_cache, io_rw_cache_free);
        io_alloc_cache_free(&ctx->uring_cache, kfree);
-       io_alloc_cache_free(&ctx->msg_cache, io_msg_cache_free);
+       io_alloc_cache_free(&ctx->msg_cache, kfree);
        io_futex_cache_free(ctx);
        kvfree(ctx->cancel_table.hbs);
        xa_destroy(&ctx->io_bl_xa);
@@ -2696,7 +2696,7 @@ static __cold void io_ring_ctx_free(struct io_ring_ctx *ctx)
        io_alloc_cache_free(&ctx->netmsg_cache, io_netmsg_cache_free);
        io_alloc_cache_free(&ctx->rw_cache, io_rw_cache_free);
        io_alloc_cache_free(&ctx->uring_cache, kfree);
-       io_alloc_cache_free(&ctx->msg_cache, io_msg_cache_free);
+       io_alloc_cache_free(&ctx->msg_cache, kfree);
        io_futex_cache_free(ctx);
        io_destroy_buffers(ctx);
        io_free_region(ctx, &ctx->param_region);
index 333c220d322a90391ec0addb140d09db50f6f95b..bd3cd78d2dba396bd2d3246ef16746f2fc8117c3 100644 (file)
@@ -354,10 +354,3 @@ int io_uring_sync_msg_ring(struct io_uring_sqe *sqe)
        return  __io_msg_ring_data(fd_file(f)->private_data,
                                   &io_msg, IO_URING_F_UNLOCKED);
 }
-
-void io_msg_cache_free(const void *entry)
-{
-       struct io_kiocb *req = (struct io_kiocb *) entry;
-
-       kmem_cache_free(req_cachep, req);
-}
index 38e7f8f0c94402c51e2e192b2c0d412ada97c730..32236d2fb77863a44ed5af158f3bf74b397b010a 100644 (file)
@@ -4,4 +4,3 @@ int io_uring_sync_msg_ring(struct io_uring_sqe *sqe);
 int io_msg_ring_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
 int io_msg_ring(struct io_kiocb *req, unsigned int issue_flags);
 void io_msg_ring_cleanup(struct io_kiocb *req);
-void io_msg_cache_free(const void *entry);