
static int io_sqe_files_unregister(struct io_ring_ctx *ctx)
{
	struct fixed_rsrc_data *data = ctx->file_data;
	unsigned nr_tables, i;
	int ret;

	/*
	 * percpu_ref_is_dying() is to stop parallel files unregister
	 * Since we possibly drop uring lock later in this function to
	 * run task work.
	 */
	if (!data || percpu_ref_is_dying(&data->refs))
		return -ENXIO;
	ret = io_rsrc_ref_quiesce(data, ctx, io_ring_file_put);
	if (ret)
		return ret;

	__io_sqe_files_unregister(ctx);
	nr_tables = DIV_ROUND_UP(ctx->nr_user_files, IORING_MAX_FILES_TABLE);
	for (i = 0; i < nr_tables; i++)
		kfree(data->table[i].files);
	free_fixed_rsrc_data(data);
	ctx->file_data = NULL;
	ctx->nr_user_files = 0;
	return 0;

static int io_sqe_files_unregister(struct io_ring_ctx *ctx)
{
	struct fixed_rsrc_data *data = ctx->file_data;
	unsigned nr_tables, i;
	int ret;

	 
	if (!data || percpu_ref_is_dying(&data->refs))
		return -ENXIO;
	ret = io_rsrc_ref_quiesce(data, ctx, io_ring_file_put);
	if (ret)
		return ret;

	__io_sqe_files_unregister(ctx);
	nr_tables = DIV_ROUND_UP(ctx->nr_user_files, IORING_MAX_FILES_TABLE);
	for (i = 0; i < nr_tables; i++)
		kfree(data->table[i].files);
	free_fixed_rsrc_data(data);
	ctx->file_data = NULL;
	ctx->nr_user_files = 0;
	return 0;