From: Yi Cong <cong.yi@linux.dev>
To: hauke@hauke-m.de, backports@vger.kernel.org
Cc: Yi Cong <yicong@kylinos.cn>
Subject: [PATCH] headers: Add timer_shutdown_sync()
Date: Tue, 12 May 2026 15:13:11 +0800 [thread overview]
Message-ID: <20260512071311.93802-1-cong.yi@linux.dev> (raw)
From: Yi Cong <yicong@kylinos.cn>
This function need delete timer and set functionm callback
to NULL
Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
backport/backport-include/linux/timer.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/backport/backport-include/linux/timer.h b/backport/backport-include/linux/timer.h
index 14467fb6..36e15340 100644
--- a/backport/backport-include/linux/timer.h
+++ b/backport/backport-include/linux/timer.h
@@ -79,4 +79,18 @@ static inline int timer_delete_sync(struct timer_list *timer)
}
#endif /* < 6.1.84 */
+#if LINUX_VERSION_IS_LESS(6,2,0)
+static inline int timer_shutdown_sync(struct timer_list *timer)
+{
+ int ret = del_timer_sync(timer);
+ /*
+ * Emulate shutdown semantics: mark as dead to prevent accidental reuse.
+ * Safe to do after del_timer_sync() because timer is no longer
+ * referenced by the timer subsystem.
+ */
+ timer->function = NULL;
+ return ret;
+}
+#endif
+
#endif /* _BACKPORT_TIMER_H */
--
2.25.1
reply other threads:[~2026-05-12 7:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260512071311.93802-1-cong.yi@linux.dev \
--to=cong.yi@linux.dev \
--cc=backports@vger.kernel.org \
--cc=hauke@hauke-m.de \
--cc=yicong@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox