git: 0dd2a3b488f0 - stable/13 - LinuxKPI: implement timer_{delete,shutdown}_sync()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Mon, 26 Jun 2023 12:09:02 UTC
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=0dd2a3b488f00df7871288fa6b85b304a7a40fc5

commit 0dd2a3b488f00df7871288fa6b85b304a7a40fc5
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-05-16 21:02:03 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-06-26 09:25:47 +0000

    LinuxKPI: implement timer_{delete,shutdown}_sync()
    
    Implement timer_{delete,shutdown}_sync(), which do not seem to require
    anything additional to the already existing del_timer_sync().
    
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    hselasky
    Differential Revision: https://reviews.freebsd.org/D40124
    
    (cherry picked from commit 2e07e885d65973f13d6111f7e0fcfb848a68082e)
---
 sys/compat/linuxkpi/common/include/linux/timer.h |  2 ++
 sys/compat/linuxkpi/common/src/linux_compat.c    | 14 ++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/timer.h b/sys/compat/linuxkpi/common/include/linux/timer.h
index 3432bfc46c4f..7b2f589a3047 100644
--- a/sys/compat/linuxkpi/common/include/linux/timer.h
+++ b/sys/compat/linuxkpi/common/include/linux/timer.h
@@ -83,6 +83,8 @@ extern void add_timer(struct timer_list *);
 extern void add_timer_on(struct timer_list *, int cpu);
 extern int del_timer(struct timer_list *);
 extern int del_timer_sync(struct timer_list *);
+extern int timer_delete_sync(struct timer_list *);
+extern int timer_shutdown_sync(struct timer_list *);
 
 #define	timer_pending(timer)	callout_pending(&(timer)->callout)
 #define	round_jiffies(j)	\
diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c
index dce3cdcc2de3..a1bf711a421e 100644
--- a/sys/compat/linuxkpi/common/src/linux_compat.c
+++ b/sys/compat/linuxkpi/common/src/linux_compat.c
@@ -2148,6 +2148,20 @@ del_timer_sync(struct timer_list *timer)
 	return (1);
 }
 
+int
+timer_delete_sync(struct timer_list *timer)
+{
+
+	return (del_timer_sync(timer));
+}
+
+int
+timer_shutdown_sync(struct timer_list *timer)
+{
+
+	return (del_timer_sync(timer));
+}
+
 /* greatest common divisor, Euclid equation */
 static uint64_t
 lkpi_gcd_64(uint64_t a, uint64_t b)