]> git.itanic.dy.fi Git - linux-stable/commitdiff
io_uring: enable io_mem_alloc/free to be used in other parts
authorJens Axboe <axboe@kernel.dk>
Tue, 28 Nov 2023 03:53:52 +0000 (20:53 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 28 Nov 2023 03:53:52 +0000 (20:53 -0700)
In preparation for using these helpers, make them non-static and add
them to our internal header.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c
io_uring/io_uring.h

index 52e4b14ad8aab4e1167172cd6f66edf150f7ec5c..e40b1143821045b93af176680c0a0745c4904225 100644 (file)
@@ -2666,7 +2666,7 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,
        return READ_ONCE(rings->cq.head) == READ_ONCE(rings->cq.tail) ? ret : 0;
 }
 
-static void io_mem_free(void *ptr)
+void io_mem_free(void *ptr)
 {
        if (!ptr)
                return;
@@ -2778,7 +2778,7 @@ static void io_rings_free(struct io_ring_ctx *ctx)
        }
 }
 
-static void *io_mem_alloc(size_t size)
+void *io_mem_alloc(size_t size)
 {
        gfp_t gfp = GFP_KERNEL_ACCOUNT | __GFP_ZERO | __GFP_NOWARN | __GFP_COMP;
        void *ret;
index dc6d779b452b9b0e233a74c7c49e0d9760840b20..ed84f2737b3a3fb25d5575a540a7703a01906f97 100644 (file)
@@ -86,6 +86,9 @@ bool __io_alloc_req_refill(struct io_ring_ctx *ctx);
 bool io_match_task_safe(struct io_kiocb *head, struct task_struct *task,
                        bool cancel_all);
 
+void *io_mem_alloc(size_t size);
+void io_mem_free(void *ptr);
+
 #if defined(CONFIG_PROVE_LOCKING)
 static inline void io_lockdep_assert_cq_locked(struct io_ring_ctx *ctx)
 {