]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-inode-permission.m4
zvol_os: fix compile with blk-mq on Linux 4.x
[mirror_zfs.git] / config / kernel-inode-permission.m4
CommitLineData
eebfd28e 1AC_DEFUN([ZFS_AC_KERNEL_SRC_PERMISSION], [
d4dc53da
YY
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>
10
7a2e54b7 11 static int test_permission(struct mnt_idmap *idmap,
d4dc53da
YY
12 struct inode *inode, int mask) { return 0; }
13
14 static const struct inode_operations
15 iops __attribute__ ((unused)) = {
7a2e54b7 16 .permission = test_permission,
d4dc53da
YY
17 };
18 ],[])
19
eebfd28e
AW
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>
27
7a2e54b7 28 static int test_permission(struct user_namespace *userns,
eebfd28e
AW
29 struct inode *inode, int mask) { return 0; }
30
31 static const struct inode_operations
32 iops __attribute__ ((unused)) = {
7a2e54b7 33 .permission = test_permission,
eebfd28e
AW
34 };
35 ],[])
36])
37
38AC_DEFUN([ZFS_AC_KERNEL_PERMISSION], [
d4dc53da
YY
39 AC_MSG_CHECKING([whether iops->permission() takes struct mnt_idmap*])
40 ZFS_LINUX_TEST_RESULT([permission_mnt_idmap], [
eebfd28e 41 AC_MSG_RESULT(yes)
d4dc53da
YY
42 AC_DEFINE(HAVE_IOPS_PERMISSION_IDMAP, 1,
43 [iops->permission() takes struct mnt_idmap*])
eebfd28e 44 ],[
d4dc53da
YY
45 AC_MSG_CHECKING([whether iops->permission() takes struct user_namespace*])
46 ZFS_LINUX_TEST_RESULT([permission_userns], [
47 AC_MSG_RESULT(yes)
48 AC_DEFINE(HAVE_IOPS_PERMISSION_USERNS, 1,
49 [iops->permission() takes struct user_namespace*])
50 ],[
51 AC_MSG_RESULT(no)
52 ])
eebfd28e
AW
53 ])
54])