Skip to content

Commit edecf16

Browse files
committed
io_uring: enable io_mem_alloc/free to be used in other parts
In preparation for using these helpers, make them non-static and add them to our internal header. Signed-off-by: Jens Axboe <[email protected]>
1 parent 6f007b1 commit edecf16

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

io_uring/io_uring.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2666,7 +2666,7 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,
26662666
return READ_ONCE(rings->cq.head) == READ_ONCE(rings->cq.tail) ? ret : 0;
26672667
}
26682668

2669-
static void io_mem_free(void *ptr)
2669+
void io_mem_free(void *ptr)
26702670
{
26712671
if (!ptr)
26722672
return;
@@ -2778,7 +2778,7 @@ static void io_rings_free(struct io_ring_ctx *ctx)
27782778
}
27792779
}
27802780

2781-
static void *io_mem_alloc(size_t size)
2781+
void *io_mem_alloc(size_t size)
27822782
{
27832783
gfp_t gfp = GFP_KERNEL_ACCOUNT | __GFP_ZERO | __GFP_NOWARN | __GFP_COMP;
27842784
void *ret;

io_uring/io_uring.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ bool __io_alloc_req_refill(struct io_ring_ctx *ctx);
8686
bool io_match_task_safe(struct io_kiocb *head, struct task_struct *task,
8787
bool cancel_all);
8888

89+
void *io_mem_alloc(size_t size);
90+
void io_mem_free(void *ptr);
91+
8992
#if defined(CONFIG_PROVE_LOCKING)
9093
static inline void io_lockdep_assert_cq_locked(struct io_ring_ctx *ctx)
9194
{

0 commit comments

Comments
 (0)