]> git.proxmox.com Git - mirror_zfs.git/blob - config/kernel-rwsem.m4
FreeBSD: Add zfs_link_create() error handling
[mirror_zfs.git] / config / kernel-rwsem.m4
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 ])
13 ])
14
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 ])
24 ])
25
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 ])
38 ])
39
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 ])
50 ])
51
52 AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM], [
53 ZFS_AC_KERNEL_SRC_RWSEM_ACTIVITY
54 ZFS_AC_KERNEL_SRC_RWSEM_ATOMIC_LONG_COUNT
55 ])
56
57 AC_DEFUN([ZFS_AC_KERNEL_RWSEM], [
58 ZFS_AC_KERNEL_RWSEM_ACTIVITY
59 ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT
60 ])