1*59915143SJens Axboe // SPDX-License-Identifier: GPL-2.0 2*59915143SJens Axboe 3*59915143SJens Axboe struct io_timeout_data { 4*59915143SJens Axboe struct io_kiocb *req; 5*59915143SJens Axboe struct hrtimer timer; 6*59915143SJens Axboe struct timespec64 ts; 7*59915143SJens Axboe enum hrtimer_mode mode; 8*59915143SJens Axboe u32 flags; 9*59915143SJens Axboe }; 10*59915143SJens Axboe 11*59915143SJens Axboe struct io_kiocb *__io_disarm_linked_timeout(struct io_kiocb *req, 12*59915143SJens Axboe struct io_kiocb *link); 13*59915143SJens Axboe 14*59915143SJens Axboe static inline struct io_kiocb *io_disarm_linked_timeout(struct io_kiocb *req) 15*59915143SJens Axboe { 16*59915143SJens Axboe struct io_kiocb *link = req->link; 17*59915143SJens Axboe 18*59915143SJens Axboe if (link && link->opcode == IORING_OP_LINK_TIMEOUT) 19*59915143SJens Axboe return __io_disarm_linked_timeout(req, link); 20*59915143SJens Axboe 21*59915143SJens Axboe return NULL; 22*59915143SJens Axboe } 23*59915143SJens Axboe 24*59915143SJens Axboe __cold void io_flush_timeouts(struct io_ring_ctx *ctx); 25*59915143SJens Axboe int io_timeout_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd); 26*59915143SJens Axboe __cold bool io_kill_timeouts(struct io_ring_ctx *ctx, struct task_struct *tsk, 27*59915143SJens Axboe bool cancel_all); 28*59915143SJens Axboe void io_queue_linked_timeout(struct io_kiocb *req); 29*59915143SJens Axboe bool io_disarm_next(struct io_kiocb *req); 30*59915143SJens Axboe 31*59915143SJens Axboe int io_timeout_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe); 32*59915143SJens Axboe int io_link_timeout_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe); 33*59915143SJens Axboe int io_timeout(struct io_kiocb *req, unsigned int issue_flags); 34*59915143SJens Axboe int io_timeout_remove_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe); 35*59915143SJens Axboe int io_timeout_remove(struct io_kiocb *req, unsigned int issue_flags); 36