Skip to content

Commit 8c0f761

Browse files
robntonyhutter
authored andcommitted
Linux 6.2/6.15: del_timer_sync() renamed to timer_delete_sync()
Renamed in 6.2, and the compat wrapper removed in 6.15. No signature or functional change apart from that, so a very minimal update for us. Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Pavel Snajdr <[email protected]> Signed-off-by: Rob Norris <[email protected]> Closes #17229 (cherry picked from commit 841be1d)
1 parent e64d471 commit 8c0f761

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

config/kernel-timer.m4

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
dnl #
2+
dnl # 6.2: timer_delete_sync introduced, del_timer_sync deprecated and made
3+
dnl # into a simple wrapper
4+
dnl # 6.15: del_timer_sync removed
5+
dnl #
6+
AC_DEFUN([ZFS_AC_KERNEL_SRC_TIMER_DELETE_SYNC], [
7+
ZFS_LINUX_TEST_SRC([timer_delete_sync], [
8+
#include <linux/timer.h>
9+
],[
10+
struct timer_list *timer __attribute__((unused)) = NULL;
11+
timer_delete_sync(timer);
12+
])
13+
])
14+
15+
AC_DEFUN([ZFS_AC_KERNEL_TIMER_DELETE_SYNC], [
16+
AC_MSG_CHECKING([whether timer_delete_sync() is available])
17+
ZFS_LINUX_TEST_RESULT([timer_delete_sync], [
18+
AC_MSG_RESULT(yes)
19+
AC_DEFINE(HAVE_TIMER_DELETE_SYNC, 1,
20+
[timer_delete_sync is available])
21+
],[
22+
AC_MSG_RESULT(no)
23+
])
24+
])
25+
26+
AC_DEFUN([ZFS_AC_KERNEL_SRC_TIMER], [
27+
ZFS_AC_KERNEL_SRC_TIMER_DELETE_SYNC
28+
])
29+
30+
AC_DEFUN([ZFS_AC_KERNEL_TIMER], [
31+
ZFS_AC_KERNEL_TIMER_DELETE_SYNC
32+
])

config/kernel.m4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
130130
ZFS_AC_KERNEL_SRC_MM_PAGE_MAPPING
131131
ZFS_AC_KERNEL_SRC_FILE
132132
ZFS_AC_KERNEL_SRC_PIN_USER_PAGES
133+
ZFS_AC_KERNEL_SRC_TIMER
133134
case "$host_cpu" in
134135
powerpc*)
135136
ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE
@@ -244,6 +245,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
244245
ZFS_AC_KERNEL_1ARG_ASSIGN_STR
245246
ZFS_AC_KERNEL_FILE
246247
ZFS_AC_KERNEL_PIN_USER_PAGES
248+
ZFS_AC_KERNEL_TIMER
247249
case "$host_cpu" in
248250
powerpc*)
249251
ZFS_AC_KERNEL_CPU_HAS_FEATURE

module/os/linux/spl/spl-taskq.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
#include <sys/kstat.h>
3939
#include <linux/cpuhotplug.h>
4040

41+
/* Linux 6.2 renamed timer_delete_sync(); point it at its old name for those. */
42+
#ifndef HAVE_TIMER_DELETE_SYNC
43+
#define timer_delete_sync(t) del_timer_sync(t)
44+
#endif
45+
4146
typedef struct taskq_kstats {
4247
/* static values, for completeness */
4348
kstat_named_t tqks_threads_max;
@@ -633,7 +638,7 @@ taskq_cancel_id(taskq_t *tq, taskqid_t id)
633638
*/
634639
if (timer_pending(&t->tqent_timer)) {
635640
spin_unlock_irqrestore(&tq->tq_lock, flags);
636-
del_timer_sync(&t->tqent_timer);
641+
timer_delete_sync(&t->tqent_timer);
637642
spin_lock_irqsave_nested(&tq->tq_lock, flags,
638643
tq->tq_lock_class);
639644
}

0 commit comments

Comments
 (0)