Remount datasets on soft-reboot
[zfs.git] / config / kernel-inode-permission.m4
blob286f73bb047ee051c098f38b7dcc253655442200
1 AC_DEFUN([ZFS_AC_KERNEL_SRC_PERMISSION], [
2         dnl #
3         dnl # 6.3 API change
4         dnl # iops->permission() now takes struct mnt_idmap*
5         dnl # as its first arg
6         dnl #
7         ZFS_LINUX_TEST_SRC([permission_mnt_idmap], [
8                 #include <linux/fs.h>
9                 #include <linux/sched.h>
11                 static int test_permission(struct mnt_idmap *idmap,
12                     struct inode *inode, int mask) { return 0; }
14                 static const struct inode_operations
15                         iops __attribute__ ((unused)) = {
16                         .permission             = test_permission,
17                 };
18         ],[])
20         dnl #
21         dnl # 5.12 API change that added the struct user_namespace* arg
22         dnl # to the front of this function type's arg list.
23         dnl #
24         ZFS_LINUX_TEST_SRC([permission_userns], [
25                 #include <linux/fs.h>
26                 #include <linux/sched.h>
28                 static int test_permission(struct user_namespace *userns,
29                     struct inode *inode, int mask) { return 0; }
31                 static const struct inode_operations
32                         iops __attribute__ ((unused)) = {
33                         .permission             = test_permission,
34                 };
35         ],[])
38 AC_DEFUN([ZFS_AC_KERNEL_PERMISSION], [
39         AC_MSG_CHECKING([whether iops->permission() takes struct mnt_idmap*])
40         ZFS_LINUX_TEST_RESULT([permission_mnt_idmap], [
41                 AC_MSG_RESULT(yes)
42                 AC_DEFINE(HAVE_IOPS_PERMISSION_IDMAP, 1,
43                    [iops->permission() takes struct mnt_idmap*])
44         ],[
45                 AC_MSG_RESULT(no)
47                 AC_MSG_CHECKING([whether iops->permission() takes struct user_namespace*])
48                 ZFS_LINUX_TEST_RESULT([permission_userns], [
49                         AC_MSG_RESULT(yes)
50                         AC_DEFINE(HAVE_IOPS_PERMISSION_USERNS, 1,
51                            [iops->permission() takes struct user_namespace*])
52                 ],[
53                         AC_MSG_RESULT(no)
54                 ])
55         ])