File: kernel-idmap_mnt_api.m4

package info (click to toggle)
zfs-linux 2.3.2-2
  • links: PTS, VCS
  • area: contrib
  • in suites: sid, trixie
  • size: 71,496 kB
  • sloc: ansic: 392,648; sh: 67,208; asm: 47,693; python: 8,160; makefile: 5,100; perl: 839; sed: 41
file content (50 lines) | stat: -rw-r--r-- 1,343 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
dnl #
dnl # 5.12 API
dnl #
dnl # Check if APIs for idmapped mount are available
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_IDMAP_MNT_API], [
        ZFS_LINUX_TEST_SRC([idmap_mnt_api], [
                #include <linux/fs.h>
        ],[
		int fs_flags = 0;
		fs_flags |= FS_ALLOW_IDMAP;
        ])
])

AC_DEFUN([ZFS_AC_KERNEL_IDMAP_MNT_API], [
        AC_MSG_CHECKING([whether APIs for idmapped mount are present])
        ZFS_LINUX_TEST_RESULT([idmap_mnt_api], [
                AC_MSG_RESULT([yes])
                AC_DEFINE(HAVE_IDMAP_MNT_API, 1,
                    [APIs for idmapped mount are present])
        ],[
                AC_MSG_RESULT([no])
        ])
])

dnl #
dnl # 6.8 decouples mnt_idmap from user_namespace. This is all internal
dnl # to mnt_idmap so we can't detect it directly, but we detect a related
dnl # change as use that as a signal.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_IDMAP_NO_USERNS], [
	ZFS_LINUX_TEST_SRC([idmap_no_userns], [
		#include <linux/uidgid.h>
	], [
		struct uid_gid_map *map = NULL;
		map_id_down(map, 0);
	])
])


AC_DEFUN([ZFS_AC_KERNEL_IDMAP_NO_USERNS], [
	AC_MSG_CHECKING([whether idmapped mounts have a user namespace])
	ZFS_LINUX_TEST_RESULT([idmap_no_userns], [
		AC_MSG_RESULT([yes])
		AC_DEFINE(HAVE_IDMAP_NO_USERNS, 1,
			[mnt_idmap does not have user_namespace])
	], [
		AC_MSG_RESULT([no])
	])
])