Tag 2.2.0-rc4
[zfs.git] / config / kernel-rwsem.m4
blobd3a64a8efa1944f86a9e9daec67575a81e5f993e
1 dnl #
2 dnl # 3.16 API Change
3 dnl #
4 dnl # rwsem-spinlock "->activity" changed to "->count"
5 dnl #
6 AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM_ACTIVITY], [
7         ZFS_LINUX_TEST_SRC([rwsem_activity], [
8                 #include <linux/rwsem.h>
9         ],[
10                 struct rw_semaphore dummy_semaphore __attribute__ ((unused));
11                 dummy_semaphore.activity = 0;
12         ])
15 AC_DEFUN([ZFS_AC_KERNEL_RWSEM_ACTIVITY], [
16         AC_MSG_CHECKING([whether struct rw_semaphore has member activity])
17         ZFS_LINUX_TEST_RESULT([rwsem_activity], [
18                 AC_MSG_RESULT(yes)
19                 AC_DEFINE(HAVE_RWSEM_ACTIVITY, 1,
20                     [struct rw_semaphore has member activity])
21         ],[
22                 AC_MSG_RESULT(no)
23         ])
26 dnl #
27 dnl # 4.8 API Change
28 dnl #
29 dnl # rwsem "->count" changed to atomic_long_t type
30 dnl #
31 AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM_ATOMIC_LONG_COUNT], [
32         ZFS_LINUX_TEST_SRC([rwsem_atomic_long_count], [
33                 #include <linux/rwsem.h>
34         ],[
35                 DECLARE_RWSEM(dummy_semaphore);
36                 (void) atomic_long_read(&dummy_semaphore.count);
37         ])
40 AC_DEFUN([ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT], [
41         AC_MSG_CHECKING(
42             [whether struct rw_semaphore has atomic_long_t member count])
43         ZFS_LINUX_TEST_RESULT([rwsem_atomic_long_count], [
44                 AC_MSG_RESULT(yes)
45                 AC_DEFINE(HAVE_RWSEM_ATOMIC_LONG_COUNT, 1,
46                     [struct rw_semaphore has atomic_long_t member count])
47         ],[
48                 AC_MSG_RESULT(no)
49         ])
52 AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM], [
53         ZFS_AC_KERNEL_SRC_RWSEM_ACTIVITY
54         ZFS_AC_KERNEL_SRC_RWSEM_ATOMIC_LONG_COUNT
57 AC_DEFUN([ZFS_AC_KERNEL_RWSEM], [
58         ZFS_AC_KERNEL_RWSEM_ACTIVITY
59         ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT