2 dnl # Check if posix_acl_release can be used from a ZFS_META_LICENSED
3 dnl # module. The is_owner_or_cap macro was replaced by
4 dnl # inode_owner_or_capable
6 AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_RELEASE], [
7 AC_MSG_CHECKING([whether posix_acl_release() is available])
8 ZFS_LINUX_TRY_COMPILE([
9 #include <linux/cred.h>
11 #include <linux/posix_acl.h>
13 struct posix_acl* tmp = posix_acl_alloc(1, 0);
14 posix_acl_release(tmp);
17 AC_DEFINE(HAVE_POSIX_ACL_RELEASE, 1,
18 [posix_acl_release() is available])
23 AC_MSG_CHECKING([whether posix_acl_release() is GPL-only])
24 ZFS_LINUX_TRY_COMPILE([
25 #include <linux/cred.h>
27 #include <linux/posix_acl.h>
29 MODULE_LICENSE("$ZFS_META_LICENSE");
31 struct posix_acl* tmp = posix_acl_alloc(1, 0);
32 posix_acl_release(tmp);
37 AC_DEFINE(HAVE_POSIX_ACL_RELEASE_GPL_ONLY, 1,
38 [posix_acl_release() is GPL-only])
44 dnl # posix_acl_chmod_masq() is not exported anymore and posix_acl_chmod()
45 dnl # was introduced to replace it.
47 dnl # 3.14 API change,
48 dnl # posix_acl_chmod() is changed to __posix_acl_chmod()
50 AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CHMOD], [
51 AC_MSG_CHECKING([whether posix_acl_chmod exists])
52 ZFS_LINUX_TRY_COMPILE([
54 #include <linux/posix_acl.h>
56 posix_acl_chmod(NULL, 0, 0)
59 AC_DEFINE(HAVE_POSIX_ACL_CHMOD, 1, [posix_acl_chmod() exists])
64 AC_MSG_CHECKING([whether __posix_acl_chmod exists])
65 ZFS_LINUX_TRY_COMPILE([
67 #include <linux/posix_acl.h>
69 __posix_acl_chmod(NULL, 0, 0)
72 AC_DEFINE(HAVE___POSIX_ACL_CHMOD, 1, [__posix_acl_chmod() exists])
79 dnl # 2.6.30 API change,
80 dnl # caching of ACL into the inode was added in this version.
82 AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CACHING], [
83 AC_MSG_CHECKING([whether inode has i_acl and i_default_acl])
84 ZFS_LINUX_TRY_COMPILE([
89 ino.i_default_acl = NULL;
92 AC_DEFINE(HAVE_POSIX_ACL_CACHING, 1,
93 [inode contains i_acl and i_default_acl])
100 dnl # 3.1 API change,
101 dnl # posix_acl_equiv_mode now wants an umode_t* instead of a mode_t*
103 AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [
104 AC_MSG_CHECKING([whether posix_acl_equiv_mode() wants umode_t])
105 ZFS_LINUX_TRY_COMPILE([
106 #include <linux/fs.h>
107 #include <linux/posix_acl.h>
110 posix_acl_equiv_mode(NULL,&tmp);
113 AC_DEFINE(HAVE_POSIX_ACL_EQUIV_MODE_UMODE_T, 1,
114 [ posix_acl_equiv_mode wants umode_t*])
121 dnl # 2.6.27 API change,
122 dnl # Check if inode_operations contains the function permission
123 dnl # and expects the nameidata structure to have been removed.
125 AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION], [
126 AC_MSG_CHECKING([whether iops->permission() exists])
127 ZFS_LINUX_TRY_COMPILE([
128 #include <linux/fs.h>
130 int permission_fn(struct inode *inode, int mask) { return 0; }
132 static const struct inode_operations
133 iops __attribute__ ((unused)) = {
134 .permission = permission_fn,
139 AC_DEFINE(HAVE_PERMISSION, 1, [iops->permission() exists])
146 dnl # 2.6.26 API change,
147 dnl # Check if inode_operations contains the function permission
148 dnl # and expects the nameidata structure to be passed.
150 AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [
151 AC_MSG_CHECKING([whether iops->permission() wants nameidata])
152 ZFS_LINUX_TRY_COMPILE([
153 #include <linux/fs.h>
155 int permission_fn(struct inode *inode, int mask,
156 struct nameidata *nd) { return 0; }
158 static const struct inode_operations
159 iops __attribute__ ((unused)) = {
160 .permission = permission_fn,
165 AC_DEFINE(HAVE_PERMISSION, 1, [iops->permission() exists])
166 AC_DEFINE(HAVE_PERMISSION_WITH_NAMEIDATA, 1,
167 [iops->permission() with nameidata exists])
174 dnl # 2.6.32 API change,
175 dnl # Check if inode_operations contains the function check_acl
177 AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL], [
178 AC_MSG_CHECKING([whether iops->check_acl() exists])
179 ZFS_LINUX_TRY_COMPILE([
180 #include <linux/fs.h>
182 int check_acl_fn(struct inode *inode, int mask) { return 0; }
184 static const struct inode_operations
185 iops __attribute__ ((unused)) = {
186 .check_acl = check_acl_fn,
191 AC_DEFINE(HAVE_CHECK_ACL, 1, [iops->check_acl() exists])
198 dnl # 2.6.38 API change,
199 dnl # The function check_acl gained a new parameter: flags
201 AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS], [
202 AC_MSG_CHECKING([whether iops->check_acl() wants flags])
203 ZFS_LINUX_TRY_COMPILE([
204 #include <linux/fs.h>
206 int check_acl_fn(struct inode *inode, int mask,
207 unsigned int flags) { return 0; }
209 static const struct inode_operations
210 iops __attribute__ ((unused)) = {
211 .check_acl = check_acl_fn,
216 AC_DEFINE(HAVE_CHECK_ACL, 1, [iops->check_acl() exists])
217 AC_DEFINE(HAVE_CHECK_ACL_WITH_FLAGS, 1,
218 [iops->check_acl() wants flags])
225 dnl # 3.1 API change,
226 dnl # Check if inode_operations contains the function get_acl
228 AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
229 AC_MSG_CHECKING([whether iops->get_acl() exists])
230 ZFS_LINUX_TRY_COMPILE([
231 #include <linux/fs.h>
233 struct posix_acl *get_acl_fn(struct inode *inode, int type)
236 static const struct inode_operations
237 iops __attribute__ ((unused)) = {
238 .get_acl = get_acl_fn,
243 AC_DEFINE(HAVE_GET_ACL, 1, [iops->get_acl() exists])
250 dnl # 2.6.30 API change,
251 dnl # current_umask exists only since this version.
253 AC_DEFUN([ZFS_AC_KERNEL_CURRENT_UMASK], [
254 AC_MSG_CHECKING([whether current_umask exists])
255 ZFS_LINUX_TRY_COMPILE([
256 #include <linux/fs.h>
261 AC_DEFINE(HAVE_CURRENT_UMASK, 1, [current_umask() exists])