summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-04-25 14:32:16 +0100
committerJens Axboe <axboe@kernel.dk>2021-04-25 10:14:04 -0600
commit44b31f2fa2c4b6479a578e74e4ed6bf7ad243955 (patch)
tree2e33e7c7a04b12f343768f41b931325f7337e441 /fs/io_uring.c
parentfff4db76be297bd4124a503948435a3917d7a702 (diff)
io_uring: return back rsrc data free helper
Add io_rsrc_data_free() helper for destroying rsrc_data, easier for search and the function will get more stuff to destroy shortly. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/562d1d53b5ff184f15b8949a63d76ef19c4ba9ec.1619356238.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 0a35881cdd0b..03f4b461c429 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -7114,6 +7114,11 @@ static int io_rsrc_ref_quiesce(struct io_rsrc_data *data, struct io_ring_ctx *ct
return ret;
}
+static void io_rsrc_data_free(struct io_rsrc_data *data)
+{
+ kfree(data);
+}
+
static struct io_rsrc_data *io_rsrc_data_alloc(struct io_ring_ctx *ctx,
rsrc_put_fn *do_put)
{
@@ -7152,7 +7157,7 @@ static void __io_sqe_files_unregister(struct io_ring_ctx *ctx)
}
#endif
io_free_file_tables(&ctx->file_table, ctx->nr_user_files);
- kfree(ctx->file_data);
+ io_rsrc_data_free(ctx->file_data);
ctx->file_data = NULL;
ctx->nr_user_files = 0;
}
@@ -7629,7 +7634,7 @@ out_fput:
io_free_file_tables(&ctx->file_table, nr_args);
ctx->nr_user_files = 0;
out_free:
- kfree(ctx->file_data);
+ io_rsrc_data_free(ctx->file_data);
ctx->file_data = NULL;
return ret;
}