io_uring: remove unused return from io_disarm_next

We removed conditional io_commit_cqring_flush() guarding against
spurious eventfd and the io_disarm_next()'s return value is not used
anymore, just void it.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/9a441c9a32a58bcc586076fa9a7d0dc33f1fb3cb.1662652536.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Pavel Begunkov 2022-09-08 16:56:57 +01:00 committed by Jens Axboe
parent 7924fdfeea
commit c0dc995eb2
2 changed files with 4 additions and 11 deletions

View File

@ -149,11 +149,10 @@ static inline void io_remove_next_linked(struct io_kiocb *req)
nxt->link = NULL; nxt->link = NULL;
} }
bool io_disarm_next(struct io_kiocb *req) void io_disarm_next(struct io_kiocb *req)
__must_hold(&req->ctx->completion_lock) __must_hold(&req->ctx->completion_lock)
{ {
struct io_kiocb *link = NULL; struct io_kiocb *link = NULL;
bool posted = false;
if (req->flags & REQ_F_ARM_LTIMEOUT) { if (req->flags & REQ_F_ARM_LTIMEOUT) {
link = req->link; link = req->link;
@ -161,7 +160,6 @@ bool io_disarm_next(struct io_kiocb *req)
if (link && link->opcode == IORING_OP_LINK_TIMEOUT) { if (link && link->opcode == IORING_OP_LINK_TIMEOUT) {
io_remove_next_linked(req); io_remove_next_linked(req);
io_req_tw_post_queue(link, -ECANCELED, 0); io_req_tw_post_queue(link, -ECANCELED, 0);
posted = true;
} }
} else if (req->flags & REQ_F_LINK_TIMEOUT) { } else if (req->flags & REQ_F_LINK_TIMEOUT) {
struct io_ring_ctx *ctx = req->ctx; struct io_ring_ctx *ctx = req->ctx;
@ -169,17 +167,12 @@ bool io_disarm_next(struct io_kiocb *req)
spin_lock_irq(&ctx->timeout_lock); spin_lock_irq(&ctx->timeout_lock);
link = io_disarm_linked_timeout(req); link = io_disarm_linked_timeout(req);
spin_unlock_irq(&ctx->timeout_lock); spin_unlock_irq(&ctx->timeout_lock);
if (link) { if (link)
posted = true;
io_req_tw_post_queue(link, -ECANCELED, 0); io_req_tw_post_queue(link, -ECANCELED, 0);
}
} }
if (unlikely((req->flags & REQ_F_FAIL) && if (unlikely((req->flags & REQ_F_FAIL) &&
!(req->flags & REQ_F_HARDLINK))) { !(req->flags & REQ_F_HARDLINK)))
posted |= (req->link != NULL);
io_fail_links(req); io_fail_links(req);
}
return posted;
} }
struct io_kiocb *__io_disarm_linked_timeout(struct io_kiocb *req, struct io_kiocb *__io_disarm_linked_timeout(struct io_kiocb *req,

View File

@ -27,7 +27,7 @@ int io_timeout_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd);
__cold bool io_kill_timeouts(struct io_ring_ctx *ctx, struct task_struct *tsk, __cold bool io_kill_timeouts(struct io_ring_ctx *ctx, struct task_struct *tsk,
bool cancel_all); bool cancel_all);
void io_queue_linked_timeout(struct io_kiocb *req); void io_queue_linked_timeout(struct io_kiocb *req);
bool io_disarm_next(struct io_kiocb *req); void io_disarm_next(struct io_kiocb *req);
int io_timeout_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe); int io_timeout_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
int io_link_timeout_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe); int io_link_timeout_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);