]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-rwsem.m4
Use boot_ncpus in place of max_ncpus in taskq_create
[mirror_zfs.git] / config / kernel-rwsem.m4
CommitLineData
48ef8ba0
BB
1dnl #
2dnl # 3.1 API Change
3dnl #
4dnl # The rw_semaphore.wait_lock member was changed from spinlock_t to
5dnl # raw_spinlock_t at commit ddb6c9b58a19edcfac93ac670b066c836ff729f1.
6dnl #
608f8749
BB
7AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM_SPINLOCK_IS_RAW], [
8 ZFS_LINUX_TEST_SRC([rwsem_spinlock_is_raw], [
48ef8ba0
BB
9 #include <linux/rwsem.h>
10 ],[
11 struct rw_semaphore dummy_semaphore __attribute__ ((unused));
12 raw_spinlock_t dummy_lock __attribute__ ((unused)) =
13 __RAW_SPIN_LOCK_INITIALIZER(dummy_lock);
14 dummy_semaphore.wait_lock = dummy_lock;
608f8749
BB
15 ])
16])
17
18AC_DEFUN([ZFS_AC_KERNEL_RWSEM_SPINLOCK_IS_RAW], [
19 AC_MSG_CHECKING([whether struct rw_semaphore member wait_lock is raw])
20 ZFS_LINUX_TEST_RESULT([rwsem_spinlock_is_raw], [
48ef8ba0 21 AC_MSG_RESULT(yes)
48ef8ba0 22 ],[
066e8252 23 ZFS_LINUX_TEST_ERROR([rwsem_spinlock_is_raw])
48ef8ba0 24 ])
48ef8ba0
BB
25])
26
27dnl #
28dnl # 3.16 API Change
29dnl #
30dnl # rwsem-spinlock "->activity" changed to "->count"
31dnl #
608f8749
BB
32AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM_ACTIVITY], [
33 ZFS_LINUX_TEST_SRC([rwsem_activity], [
48ef8ba0
BB
34 #include <linux/rwsem.h>
35 ],[
36 struct rw_semaphore dummy_semaphore __attribute__ ((unused));
37 dummy_semaphore.activity = 0;
608f8749
BB
38 ])
39])
40
41AC_DEFUN([ZFS_AC_KERNEL_RWSEM_ACTIVITY], [
42 AC_MSG_CHECKING([whether struct rw_semaphore has member activity])
43 ZFS_LINUX_TEST_RESULT([rwsem_activity], [
48ef8ba0
BB
44 AC_MSG_RESULT(yes)
45 AC_DEFINE(HAVE_RWSEM_ACTIVITY, 1,
608f8749 46 [struct rw_semaphore has member activity])
48ef8ba0
BB
47 ],[
48 AC_MSG_RESULT(no)
49 ])
48ef8ba0
BB
50])
51
52dnl #
53dnl # 4.8 API Change
54dnl #
55dnl # rwsem "->count" changed to atomic_long_t type
56dnl #
608f8749
BB
57AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM_ATOMIC_LONG_COUNT], [
58 ZFS_LINUX_TEST_SRC([rwsem_atomic_long_count], [
48ef8ba0
BB
59 #include <linux/rwsem.h>
60 ],[
61 DECLARE_RWSEM(dummy_semaphore);
62 (void) atomic_long_read(&dummy_semaphore.count);
608f8749
BB
63 ])
64])
65
66AC_DEFUN([ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT], [
67 AC_MSG_CHECKING(
68 [whether struct rw_semaphore has atomic_long_t member count])
69 ZFS_LINUX_TEST_RESULT([rwsem_atomic_long_count], [
48ef8ba0
BB
70 AC_MSG_RESULT(yes)
71 AC_DEFINE(HAVE_RWSEM_ATOMIC_LONG_COUNT, 1,
608f8749 72 [struct rw_semaphore has atomic_long_t member count])
48ef8ba0
BB
73 ],[
74 AC_MSG_RESULT(no)
75 ])
608f8749
BB
76])
77
78AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM], [
79 ZFS_AC_KERNEL_SRC_RWSEM_SPINLOCK_IS_RAW
80 ZFS_AC_KERNEL_SRC_RWSEM_ACTIVITY
81 ZFS_AC_KERNEL_SRC_RWSEM_ATOMIC_LONG_COUNT
82])
83
84AC_DEFUN([ZFS_AC_KERNEL_RWSEM], [
85 ZFS_AC_KERNEL_RWSEM_SPINLOCK_IS_RAW
86 ZFS_AC_KERNEL_RWSEM_ACTIVITY
87 ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT
48ef8ba0 88])