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