static bool __tctx_task_work(struct io_uring_task *tctx)
{
	struct io_ring_ctx *ctx = NULL;
	struct io_wq_work_list list;
	struct io_wq_work_node *node;

	if (wq_list_empty(&tctx->task_list))
		return false;

	spin_lock_irq(&tctx->task_lock);
	list = tctx->task_list;
	INIT_WQ_LIST(&tctx->task_list);
	spin_unlock_irq(&tctx->task_lock);

	node = list.first;
	while (node) {
		struct io_wq_work_node *next = node->next;
		struct io_kiocb *req;

		req = container_of(node, struct io_kiocb, io_task_work.node);
		if (req->ctx != ctx) {
			ctx_flush_and_put(ctx);
			ctx = req->ctx;
			percpu_ref_get(&ctx->refs);
		}

		req->task_work.func(&req->task_work);
		node = next;
	}

	ctx_flush_and_put(ctx);
	return list.first != NULL;
}
static bool __tctx_task_work(struct io_uring_task *tctx)
{
	struct io_ring_ctx *ctx = NULL;
	struct io_wq_work_list list;
	struct io_wq_work_node *node;

	if (wq_list_empty(&tctx->task_list))
		return false;

	spin_lock_irq(&tctx->task_lock);
	list = tctx->task_list;
	INIT_WQ_LIST(&tctx->task_list);
	spin_unlock_irq(&tctx->task_lock);

	node = list.first;
	while (node) {
		struct io_wq_work_node *next = node->next;
		struct io_kiocb *req;

		req = container_of(node, struct io_kiocb, io_task_work.node);
		if (req->ctx != ctx) {
			ctx_flush_and_put(ctx);
			ctx = req->ctx;
			percpu_ref_get(&ctx->refs);
		}

		req->task_work.func(&req->task_work);
		node = next;
	}

	ctx_flush_and_put(ctx);
	return list.first != NULL;
}