* [PATCH 1/1] io_uring/timeout: don't export link t-out disarm helper
@ 2025-05-06 12:30 Pavel Begunkov
2025-05-06 13:48 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2025-05-06 12:30 UTC (permalink / raw)
To: io-uring; +Cc: asml.silence
[__]io_disarm_linked_timeout() are only used inside timeout.c. so
confine them inside the file.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
io_uring/timeout.c | 11 ++++++++---
io_uring/timeout.h | 13 -------------
2 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/io_uring/timeout.c b/io_uring/timeout.c
index 2a107665230b..a6ff8c026b1f 100644
--- a/io_uring/timeout.c
+++ b/io_uring/timeout.c
@@ -35,6 +35,9 @@ struct io_timeout_rem {
bool ltimeout;
};
+static struct io_kiocb *__io_disarm_linked_timeout(struct io_kiocb *req,
+ struct io_kiocb *link);
+
static inline bool io_is_timeout_noseq(struct io_kiocb *req)
{
struct io_timeout *timeout = io_kiocb_to_cmd(req, struct io_timeout);
@@ -218,7 +221,9 @@ void io_disarm_next(struct io_kiocb *req)
struct io_ring_ctx *ctx = req->ctx;
raw_spin_lock_irq(&ctx->timeout_lock);
- link = io_disarm_linked_timeout(req);
+ if (req->link && req->link->opcode == IORING_OP_LINK_TIMEOUT)
+ link = __io_disarm_linked_timeout(req, req->link);
+
raw_spin_unlock_irq(&ctx->timeout_lock);
if (link)
io_req_queue_tw_complete(link, -ECANCELED);
@@ -228,8 +233,8 @@ void io_disarm_next(struct io_kiocb *req)
io_fail_links(req);
}
-struct io_kiocb *__io_disarm_linked_timeout(struct io_kiocb *req,
- struct io_kiocb *link)
+static struct io_kiocb *__io_disarm_linked_timeout(struct io_kiocb *req,
+ struct io_kiocb *link)
__must_hold(&req->ctx->completion_lock)
__must_hold(&req->ctx->timeout_lock)
{
diff --git a/io_uring/timeout.h b/io_uring/timeout.h
index e91b32448dcf..2b7c9ad72992 100644
--- a/io_uring/timeout.h
+++ b/io_uring/timeout.h
@@ -8,19 +8,6 @@ struct io_timeout_data {
u32 flags;
};
-struct io_kiocb *__io_disarm_linked_timeout(struct io_kiocb *req,
- struct io_kiocb *link);
-
-static inline struct io_kiocb *io_disarm_linked_timeout(struct io_kiocb *req)
-{
- struct io_kiocb *link = req->link;
-
- if (link && link->opcode == IORING_OP_LINK_TIMEOUT)
- return __io_disarm_linked_timeout(req, link);
-
- return NULL;
-}
-
__cold void io_flush_timeouts(struct io_ring_ctx *ctx);
struct io_cancel_data;
int io_timeout_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd);
--
2.48.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] io_uring/timeout: don't export link t-out disarm helper
2025-05-06 12:30 [PATCH 1/1] io_uring/timeout: don't export link t-out disarm helper Pavel Begunkov
@ 2025-05-06 13:48 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2025-05-06 13:48 UTC (permalink / raw)
To: io-uring, Pavel Begunkov
On Tue, 06 May 2025 13:30:47 +0100, Pavel Begunkov wrote:
> [__]io_disarm_linked_timeout() are only used inside timeout.c. so
> confine them inside the file.
>
>
Applied, thanks!
[1/1] io_uring/timeout: don't export link t-out disarm helper
commit: 609f8a2577c11c5dfe7274d11a113c31ad388621
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-06 13:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-06 12:30 [PATCH 1/1] io_uring/timeout: don't export link t-out disarm helper Pavel Begunkov
2025-05-06 13:48 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox