static void __io_fail_links(struct io_kiocb *req)
{
	struct io_ring_ctx *ctx = req->ctx;

	while (!list_empty(&req->link_list)) {
		struct io_kiocb *link = list_first_entry(&req->link_list,
						struct io_kiocb, link_list);

		list_del_init(&link->link_list);
		trace_io_uring_fail_link(req, link);

		io_cqring_fill_event(link, -ECANCELED);
		link->flags |= REQ_F_COMP_LOCKED;
		__io_double_put_req(link);
		req->flags &= ~REQ_F_LINK_TIMEOUT;
	}

	io_commit_cqring(ctx);
	io_cqring_ev_posted(ctx);
}
static void __io_fail_links(struct io_kiocb *req)
{
	struct io_ring_ctx *ctx = req->ctx;

	while (!list_empty(&req->link_list)) {
		struct io_kiocb *link = list_first_entry(&req->link_list,
						struct io_kiocb, link_list);

		list_del_init(&link->link_list);
		trace_io_uring_fail_link(req, link);

		io_cqring_fill_event(link, -ECANCELED);
		link->flags |= REQ_F_COMP_LOCKED;
		__io_double_put_req(link);
		req->flags &= ~REQ_F_LINK_TIMEOUT;
	}

	io_commit_cqring(ctx);
	io_cqring_ev_posted(ctx);
}