Lines Matching defs:link
309 struct io_submit_link link;
543 /* head of the link, used by linked timeouts only */
878 struct io_kiocb *link;
1138 for (pos = (head); pos; pos = pos->link)
1413 if (WARN_ON_ONCE(!req->link))
1421 __io_req_set_refcount(req->link, 2);
1422 return req->link;
1476 struct io_kiocb *link = io_prep_linked_timeout(req);
1485 /* init ->work of the whole link before punting */
1501 if (link)
1502 io_queue_linked_timeout(link);
1857 if (req->link) {
1858 io_req_task_queue(req->link);
1859 req->link = NULL;
1932 req->link = NULL;
2055 struct io_kiocb *nxt = req->link;
2057 req->link = nxt->link;
2058 nxt->link = NULL;
2065 struct io_kiocb *link = req->link;
2067 if (link && link->opcode == IORING_OP_LINK_TIMEOUT) {
2068 struct io_timeout_data *io = link->async_data;
2071 link->timeout.head = NULL;
2073 list_del(&link->timeout.list);
2074 io_fill_cqe_req(link, -ECANCELED, 0);
2075 io_put_req_deferred(link);
2085 struct io_kiocb *nxt, *link = req->link;
2087 req->link = NULL;
2088 while (link) {
2091 if (link->flags & REQ_F_FAIL)
2092 res = link->result;
2094 nxt = link->link;
2095 link->link = NULL;
2097 trace_io_uring_fail_link(req, link);
2098 io_fill_cqe_req(link, res, 0);
2099 io_put_req_deferred(link);
2100 link = nxt;
2110 struct io_kiocb *link = req->link;
2113 if (link && link->opcode == IORING_OP_LINK_TIMEOUT) {
2115 io_fill_cqe_req(link, -ECANCELED, 0);
2116 io_put_req_deferred(link);
2128 posted |= (req->link != NULL);
2156 nxt = req->link;
2157 req->link = NULL;
6282 struct io_submit_link *link = &req->ctx->submit_state.link;
6284 if (!link->head)
6286 if (link->last->opcode == IORING_OP_LINK_TIMEOUT)
6288 req->timeout.head = link->last;
6289 link->last->flags |= REQ_F_ARM_LTIMEOUT;
6618 * If we need to drain a request in the middle of a link, drain the
6619 * head request and the next request/link after the current link.
6621 * maintained for every request of our link.
6628 io_for_each_link(pos, req->link) {
7230 struct io_submit_link *link = &ctx->submit_state.link;
7237 if (link->head) {
7239 * we can judge a link req is failed or cancelled by if
7247 if (!(link->head->flags & REQ_F_FAIL))
7248 req_fail_link_node(link->head, -ECANCELED);
7276 if (link->head) {
7277 struct io_kiocb *head = link->head;
7288 link->last->link = req;
7289 link->last = req;
7291 /* last request of a link, enqueue the link */
7293 link->head = NULL;
7298 link->head = req;
7299 link->last = req;
7314 if (state->link.head)
7315 io_queue_sqe(state->link.head);
7331 state->link.head = NULL;