3 dnl # posix_acl_equiv_mode now wants an umode_t instead of a mode_t
5 AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [
6 ZFS_LINUX_TEST_SRC([posix_acl_equiv_mode], [
8 #include <linux/posix_acl.h>
11 posix_acl_equiv_mode(NULL, &tmp);
15 AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [
16 AC_MSG_CHECKING([whether posix_acl_equiv_mode() wants umode_t])
17 ZFS_LINUX_TEST_RESULT([posix_acl_equiv_mode], [
20 ZFS_LINUX_TEST_ERROR([posix_acl_equiv_mode()])
26 dnl # Check if inode_operations contains the function get_acl
28 dnl # 5.15 API change,
29 dnl # Added the bool rcu argument to get_acl for rcu path walk.
32 dnl # get_acl() was renamed to get_inode_acl()
34 AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL], [
35 ZFS_LINUX_TEST_SRC([inode_operations_get_acl], [
38 static struct posix_acl *get_acl_fn(struct inode *inode, int type)
41 static const struct inode_operations
42 iops __attribute__ ((unused)) = {
43 .get_acl = get_acl_fn,
47 ZFS_LINUX_TEST_SRC([inode_operations_get_acl_rcu], [
50 static struct posix_acl *get_acl_fn(struct inode *inode, int type,
51 bool rcu) { return NULL; }
53 static const struct inode_operations
54 iops __attribute__ ((unused)) = {
55 .get_acl = get_acl_fn,
59 ZFS_LINUX_TEST_SRC([inode_operations_get_inode_acl], [
62 static struct posix_acl *get_inode_acl_fn(struct inode *inode, int type,
63 bool rcu) { return NULL; }
65 static const struct inode_operations
66 iops __attribute__ ((unused)) = {
67 .get_inode_acl = get_inode_acl_fn,
72 AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
73 AC_MSG_CHECKING([whether iops->get_acl() exists])
74 ZFS_LINUX_TEST_RESULT([inode_operations_get_acl], [
76 AC_DEFINE(HAVE_GET_ACL, 1, [iops->get_acl() exists])
78 ZFS_LINUX_TEST_RESULT([inode_operations_get_acl_rcu], [
80 AC_DEFINE(HAVE_GET_ACL_RCU, 1, [iops->get_acl() takes rcu])
82 ZFS_LINUX_TEST_RESULT([inode_operations_get_inode_acl], [
84 AC_DEFINE(HAVE_GET_INODE_ACL, 1, [has iops->get_inode_acl()])
86 ZFS_LINUX_TEST_ERROR([iops->get_acl() or iops->get_inode_acl()])
93 dnl # 5.12 API change,
94 dnl # set_acl() added a user_namespace* parameter first
97 dnl # set_acl() second paramter changed to a struct dentry *
100 dnl # set_acl() first parameter changed to struct mnt_idmap *
102 AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
103 ZFS_LINUX_TEST_SRC([inode_operations_set_acl_mnt_idmap_dentry], [
104 #include <linux/fs.h>
106 static int set_acl_fn(struct mnt_idmap *idmap,
107 struct dentry *dent, struct posix_acl *acl,
108 int type) { return 0; }
110 static const struct inode_operations
111 iops __attribute__ ((unused)) = {
112 .set_acl = set_acl_fn,
115 ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns_dentry], [
116 #include <linux/fs.h>
118 static int set_acl_fn(struct user_namespace *userns,
119 struct dentry *dent, struct posix_acl *acl,
120 int type) { return 0; }
122 static const struct inode_operations
123 iops __attribute__ ((unused)) = {
124 .set_acl = set_acl_fn,
127 ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns], [
128 #include <linux/fs.h>
130 static int set_acl_fn(struct user_namespace *userns,
131 struct inode *inode, struct posix_acl *acl,
132 int type) { return 0; }
134 static const struct inode_operations
135 iops __attribute__ ((unused)) = {
136 .set_acl = set_acl_fn,
139 ZFS_LINUX_TEST_SRC([inode_operations_set_acl], [
140 #include <linux/fs.h>
142 static int set_acl_fn(struct inode *inode, struct posix_acl *acl,
143 int type) { return 0; }
145 static const struct inode_operations
146 iops __attribute__ ((unused)) = {
147 .set_acl = set_acl_fn,
152 AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [
153 AC_MSG_CHECKING([whether iops->set_acl() with 4 args exists])
154 ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns], [
156 AC_DEFINE(HAVE_SET_ACL_USERNS, 1, [iops->set_acl() takes 4 args])
158 ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_mnt_idmap_dentry], [
160 AC_DEFINE(HAVE_SET_ACL_IDMAP_DENTRY, 1,
161 [iops->set_acl() takes 4 args, arg1 is struct mnt_idmap *])
163 ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns_dentry], [
165 AC_DEFINE(HAVE_SET_ACL_USERNS_DENTRY_ARG2, 1,
166 [iops->set_acl() takes 4 args, arg2 is struct dentry *])
174 AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL], [
175 ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
176 ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL
177 ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL
180 AC_DEFUN([ZFS_AC_KERNEL_ACL], [
181 ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
182 ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL
183 ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL