BRT: Clear bv_entcount_dirty on destroy
[zfs.git] / config / kernel-userns-capabilities.m4
blobf4e24fb1606a562f36c60f8aa5133008b50ce8d3
1 dnl #
2 dnl # 2.6.38 API change
3 dnl # ns_capable() was introduced
4 dnl #
5 AC_DEFUN([ZFS_AC_KERNEL_SRC_NS_CAPABLE], [
6         ZFS_LINUX_TEST_SRC([ns_capable], [
7                 #include <linux/capability.h>
8         ],[
9                 ns_capable((struct user_namespace *)NULL, CAP_SYS_ADMIN);
10         ])
13 AC_DEFUN([ZFS_AC_KERNEL_NS_CAPABLE], [
14         AC_MSG_CHECKING([whether ns_capable exists])
15         ZFS_LINUX_TEST_RESULT([ns_capable], [
16                 AC_MSG_RESULT(yes)
17         ],[
18                 ZFS_LINUX_TEST_ERROR([ns_capable()])
19         ])
22 dnl #
23 dnl # 2.6.39 API change
24 dnl # struct user_namespace was added to struct cred_t as cred->user_ns member
25 dnl #
26 AC_DEFUN([ZFS_AC_KERNEL_SRC_CRED_USER_NS], [
27         ZFS_LINUX_TEST_SRC([cred_user_ns], [
28                 #include <linux/cred.h>
29         ],[
30                 struct cred cr;
31                 cr.user_ns = (struct user_namespace *)NULL;
32         ])
35 AC_DEFUN([ZFS_AC_KERNEL_CRED_USER_NS], [
36         AC_MSG_CHECKING([whether cred_t->user_ns exists])
37         ZFS_LINUX_TEST_RESULT([cred_user_ns], [
38                 AC_MSG_RESULT(yes)
39         ],[
40                 ZFS_LINUX_TEST_ERROR([cred_t->user_ns()])
41         ])
44 dnl #
45 dnl # 3.4 API change
46 dnl # kuid_has_mapping() and kgid_has_mapping() were added to distinguish
47 dnl # between internal kernel uids/gids and user namespace uids/gids.
48 dnl #
49 AC_DEFUN([ZFS_AC_KERNEL_SRC_KUID_HAS_MAPPING], [
50         ZFS_LINUX_TEST_SRC([kuid_has_mapping], [
51                 #include <linux/uidgid.h>
52         ],[
53                 kuid_has_mapping((struct user_namespace *)NULL, KUIDT_INIT(0));
54                 kgid_has_mapping((struct user_namespace *)NULL, KGIDT_INIT(0));
55         ])
58 AC_DEFUN([ZFS_AC_KERNEL_KUID_HAS_MAPPING], [
59         AC_MSG_CHECKING([whether kuid_has_mapping/kgid_has_mapping exist])
60         ZFS_LINUX_TEST_RESULT([kuid_has_mapping], [
61                 AC_MSG_RESULT(yes)
62         ],[
63                 ZFS_LINUX_TEST_ERROR([kuid_has_mapping()])
64         ])
67 AC_DEFUN([ZFS_AC_KERNEL_SRC_USERNS_CAPABILITIES], [
68         ZFS_AC_KERNEL_SRC_NS_CAPABLE
69         ZFS_AC_KERNEL_SRC_HAS_CAPABILITY
70         ZFS_AC_KERNEL_SRC_CRED_USER_NS
71         ZFS_AC_KERNEL_SRC_KUID_HAS_MAPPING
74 AC_DEFUN([ZFS_AC_KERNEL_USERNS_CAPABILITIES], [
75         ZFS_AC_KERNEL_NS_CAPABLE
76         ZFS_AC_KERNEL_HAS_CAPABILITY
77         ZFS_AC_KERNEL_CRED_USER_NS
78         ZFS_AC_KERNEL_KUID_HAS_MAPPING