
static struct io_kiocb *io_timeout_extract(struct io_ring_ctx *ctx,
					   __u64 user_data)
{
	struct io_timeout_data *io;
	struct io_kiocb *req;
	int ret = -ENOENT;

	list_for_each_entry(req, &ctx->timeout_list, timeout.list) {
		if (user_data == req->user_data) {
			ret = 0;
			break;
		}
	}

	if (ret == -ENOENT)
		return ERR_PTR(ret);

	io = req->async_data;
	ret = hrtimer_try_to_cancel(&io->timer);
	if (ret == -1)
		return ERR_PTR(-EALREADY);
	list_del_init(&req->timeout.list);
	return req;

static struct io_kiocb *io_timeout_extract(struct io_ring_ctx *ctx,
					   __u64 user_data)
{
	struct io_timeout_data *io;
	struct io_kiocb *req;
	int ret = -ENOENT;

	list_for_each_entry(req, &ctx->timeout_list, timeout.list) {
		if (user_data == req->user_data) {
			ret = 0;
			break;
		}
	}

	if (ret == -ENOENT)
		return ERR_PTR(ret);

	io = req->async_data;
	ret = hrtimer_try_to_cancel(&io->timer);
	if (ret == -1)
		return ERR_PTR(-EALREADY);
	list_del_init(&req->timeout.list);
	return req;