Skip to content

Commit 44b31f2

Browse files
isilenceaxboe
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/562d1d53b5ff184f15b8949a63d76ef19c4ba9ec.1619356238.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent fff4db7 commit 44b31f2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

fs/io_uring.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7114,6 +7114,11 @@ static int io_rsrc_ref_quiesce(struct io_rsrc_data *data, struct io_ring_ctx *ct
71147114
return ret;
71157115
}
71167116

7117+
static void io_rsrc_data_free(struct io_rsrc_data *data)
7118+
{
7119+
kfree(data);
7120+
}
7121+
71177122
static struct io_rsrc_data *io_rsrc_data_alloc(struct io_ring_ctx *ctx,
71187123
rsrc_put_fn *do_put)
71197124
{
@@ -7152,7 +7157,7 @@ static void __io_sqe_files_unregister(struct io_ring_ctx *ctx)
71527157
}
71537158
#endif
71547159
io_free_file_tables(&ctx->file_table, ctx->nr_user_files);
7155-
kfree(ctx->file_data);
7160+
io_rsrc_data_free(ctx->file_data);
71567161
ctx->file_data = NULL;
71577162
ctx->nr_user_files = 0;
71587163
}
@@ -7629,7 +7634,7 @@ static int io_sqe_files_register(struct io_ring_ctx *ctx, void __user *arg,
76297634
io_free_file_tables(&ctx->file_table, nr_args);
76307635
ctx->nr_user_files = 0;
76317636
out_free:
7632-
kfree(ctx->file_data);
7637+
io_rsrc_data_free(ctx->file_data);
76337638
ctx->file_data = NULL;
76347639
return ret;
76357640
}

0 commit comments

Comments
 (0)