]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - config/kernel-idmap_mnt_api.m4
ztest: use ASSERT3P to compare pointers
[FreeBSD/FreeBSD.git] / config / kernel-idmap_mnt_api.m4
1 dnl #
2 dnl # 5.12 API
3 dnl #
4 dnl # Check if APIs for idmapped mount are available
5 dnl #
6 AC_DEFUN([ZFS_AC_KERNEL_SRC_IDMAP_MNT_API], [
7         ZFS_LINUX_TEST_SRC([idmap_mnt_api], [
8                 #include <linux/fs.h>
9         ],[
10                 int fs_flags = 0;
11                 fs_flags |= FS_ALLOW_IDMAP;
12         ])
13 ])
14
15 AC_DEFUN([ZFS_AC_KERNEL_IDMAP_MNT_API], [
16         AC_MSG_CHECKING([whether APIs for idmapped mount are present])
17         ZFS_LINUX_TEST_RESULT([idmap_mnt_api], [
18                 AC_MSG_RESULT([yes])
19                 AC_DEFINE(HAVE_IDMAP_MNT_API, 1,
20                     [APIs for idmapped mount are present])
21         ],[
22                 AC_MSG_RESULT([no])
23         ])
24 ])
25
26 dnl #
27 dnl # 6.8 decouples mnt_idmap from user_namespace. This is all internal
28 dnl # to mnt_idmap so we can't detect it directly, but we detect a related
29 dnl # change as use that as a signal.
30 dnl #
31 AC_DEFUN([ZFS_AC_KERNEL_SRC_IDMAP_NO_USERNS], [
32         ZFS_LINUX_TEST_SRC([idmap_no_userns], [
33                 #include <linux/uidgid.h>
34         ], [
35                 struct uid_gid_map *map = NULL;
36                 map_id_down(map, 0);
37         ])
38 ])
39
40
41 AC_DEFUN([ZFS_AC_KERNEL_IDMAP_NO_USERNS], [
42         AC_MSG_CHECKING([whether idmapped mounts have a user namespace])
43         ZFS_LINUX_TEST_RESULT([idmap_no_userns], [
44                 AC_MSG_RESULT([yes])
45                 AC_DEFINE(HAVE_IDMAP_NO_USERNS, 1,
46                         [mnt_idmap does not have user_namespace])
47         ], [
48                 AC_MSG_RESULT([no])
49         ])
50 ])