]> granicus.if.org Git - zfs/blob - config/kernel-timer.m4
Fix memory leaks in zfsvfs_create_impl()
[zfs] / config / kernel-timer.m4
1 dnl #
2 dnl # 4.15 API change
3 dnl # https://lkml.org/lkml/2017/11/25/90
4 dnl # Check if timer_list.func get passed a timer_list or an unsigned long
5 dnl # (older kernels).  Also sanity check the from_timer() and timer_setup()
6 dnl # macros are available as well, since they will be used in the same newer
7 dnl # kernels that support the new timer_list.func signature.
8 dnl #
9 AC_DEFUN([ZFS_AC_KERNEL_TIMER_FUNCTION_TIMER_LIST], [
10         AC_MSG_CHECKING([whether timer_list.function gets a timer_list])
11         tmp_flags="$EXTRA_KCFLAGS"
12         EXTRA_KCFLAGS="-Werror"
13         ZFS_LINUX_TRY_COMPILE([
14                 #include <linux/timer.h>
15                 void task_expire(struct timer_list *tl) {}
16         ],[
17                 #ifndef from_timer
18                 #error "No from_timer() macro"
19                 #endif
20
21                 struct timer_list timer;
22                 timer.function = task_expire;
23                 timer_setup(&timer, NULL, 0);
24         ],[
25                 AC_MSG_RESULT(yes)
26                 AC_DEFINE(HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST, 1,
27                     [timer_list.function gets a timer_list])
28         ],[
29                 AC_MSG_RESULT(no)
30         ])
31         EXTRA_KCFLAGS="$tmp_flags"
32 ])