xref: /freebsd/sys/contrib/openzfs/config/kernel-percpu.m4 (revision 96190b4fef3b4a0cc3ca0606b0c4e3e69a5e6717)
1dnl #
2dnl # 5.10 API change,
3dnl # The "count" was moved into ref->data, from ref
4dnl #
5AC_DEFUN([ZFS_AC_KERNEL_SRC_PERCPU_REF_COUNT_IN_DATA], [
6	ZFS_LINUX_TEST_SRC([percpu_ref_count_in_data], [
7		#include <linux/percpu-refcount.h>
8	],[
9		struct percpu_ref_data d;
10
11		atomic_long_set(&d.count, 1L);
12	])
13])
14
15AC_DEFUN([ZFS_AC_KERNEL_PERCPU_REF_COUNT_IN_DATA], [
16	AC_MSG_CHECKING([whether is inside percpu_ref.data])
17	ZFS_LINUX_TEST_RESULT([percpu_ref_count_in_data], [
18		AC_MSG_RESULT(yes)
19		AC_DEFINE(ZFS_PERCPU_REF_COUNT_IN_DATA, 1,
20		    [count is located in percpu_ref.data])
21	],[
22		AC_MSG_RESULT(no)
23	])
24])
25AC_DEFUN([ZFS_AC_KERNEL_SRC_PERCPU], [
26	ZFS_AC_KERNEL_SRC_PERCPU_REF_COUNT_IN_DATA
27])
28
29AC_DEFUN([ZFS_AC_KERNEL_PERCPU], [
30	ZFS_AC_KERNEL_PERCPU_REF_COUNT_IN_DATA
31])
32