summaryrefslogtreecommitdiff
path: root/io_uring/io_uring.c
diff options
context:
space:
mode:
authorDavid Wei <dw@davidwei.uk>2025-11-04 14:44:53 -0800
committerJens Axboe <axboe@kernel.dk>2025-11-06 16:23:21 -0700
commit1fa7a34131110e3c41a13b19127da132dea32dcd (patch)
tree79910f1fb6bbec02237e4295d63b03ffe27e9727 /io_uring/io_uring.c
parenta5af56a9020c0dd27bc6ab2b58d1820b01621612 (diff)
downloadlinux-next-1fa7a34131110e3c41a13b19127da132dea32dcd.tar.gz
linux-next-1fa7a34131110e3c41a13b19127da132dea32dcd.zip
io_uring/memmap: refactor io_free_region() to take user_struct param
Refactor io_free_region() to take user_struct directly, instead of accessing it from the ring ctx. Signed-off-by: David Wei <dw@davidwei.uk> Reviewed-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/io_uring.c')
-rw-r--r--io_uring/io_uring.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 2d49b48568ab..85081d7453b7 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -2751,8 +2751,8 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events, u32 flags,
static void io_rings_free(struct io_ring_ctx *ctx)
{
- io_free_region(ctx, &ctx->sq_region);
- io_free_region(ctx, &ctx->ring_region);
+ io_free_region(ctx->user, &ctx->sq_region);
+ io_free_region(ctx->user, &ctx->ring_region);
ctx->rings = NULL;
ctx->sq_sqes = NULL;
}
@@ -2837,7 +2837,7 @@ static __cold void io_ring_ctx_free(struct io_ring_ctx *ctx)
io_eventfd_unregister(ctx);
io_free_alloc_caches(ctx);
io_destroy_buffers(ctx);
- io_free_region(ctx, &ctx->param_region);
+ io_free_region(ctx->user, &ctx->param_region);
mutex_unlock(&ctx->uring_lock);
if (ctx->sq_creds)
put_cred(ctx->sq_creds);