]> git.proxmox.com Git - mirror_zfs.git/blobdiff - config/kernel-acl.m4
FreeBSD: Add zfs_link_create() error handling
[mirror_zfs.git] / config / kernel-acl.m4
index 238742901f3497aa4b17eee0edaf6b8038bbe512..3ae5dc6b6dbc5b59bf9302443c3b094ad95e46cf 100644 (file)
@@ -165,11 +165,14 @@ dnl #
 dnl # 5.15 API change,
 dnl # Added the bool rcu argument to get_acl for rcu path walk.
 dnl #
+dnl # 6.2 API change,
+dnl # get_acl() was renamed to get_inode_acl()
+dnl #
 AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL], [
        ZFS_LINUX_TEST_SRC([inode_operations_get_acl], [
                #include <linux/fs.h>
 
-               struct posix_acl *get_acl_fn(struct inode *inode, int type)
+               static struct posix_acl *get_acl_fn(struct inode *inode, int type)
                    { return NULL; }
 
                static const struct inode_operations
@@ -181,7 +184,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL], [
        ZFS_LINUX_TEST_SRC([inode_operations_get_acl_rcu], [
                #include <linux/fs.h>
 
-               struct posix_acl *get_acl_fn(struct inode *inode, int type,
+               static struct posix_acl *get_acl_fn(struct inode *inode, int type,
                    bool rcu) { return NULL; }
 
                static const struct inode_operations
@@ -193,7 +196,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL], [
        ZFS_LINUX_TEST_SRC([inode_operations_get_inode_acl], [
                #include <linux/fs.h>
 
-               struct posix_acl *get_inode_acl_fn(struct inode *inode, int type,
+               static struct posix_acl *get_inode_acl_fn(struct inode *inode, int type,
                    bool rcu) { return NULL; }
 
                static const struct inode_operations
@@ -230,11 +233,41 @@ dnl #
 dnl # 5.12 API change,
 dnl # set_acl() added a user_namespace* parameter first
 dnl #
+dnl # 6.2 API change,
+dnl # set_acl() second paramter changed to a struct dentry *
+dnl #
+dnl # 6.3 API change,
+dnl # set_acl() first parameter changed to struct mnt_idmap *
+dnl #
 AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
+       ZFS_LINUX_TEST_SRC([inode_operations_set_acl_mnt_idmap_dentry], [
+               #include <linux/fs.h>
+
+               static int set_acl_fn(struct mnt_idmap *idmap,
+                   struct dentry *dent, struct posix_acl *acl,
+                   int type) { return 0; }
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .set_acl = set_acl_fn,
+               };
+       ],[])
+       ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns_dentry], [
+               #include <linux/fs.h>
+
+               static int set_acl_fn(struct user_namespace *userns,
+                   struct dentry *dent, struct posix_acl *acl,
+                   int type) { return 0; }
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .set_acl = set_acl_fn,
+               };
+       ],[])
        ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns], [
                #include <linux/fs.h>
 
-               int set_acl_fn(struct user_namespace *userns,
+               static int set_acl_fn(struct user_namespace *userns,
                    struct inode *inode, struct posix_acl *acl,
                    int type) { return 0; }
 
@@ -246,7 +279,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
        ZFS_LINUX_TEST_SRC([inode_operations_set_acl], [
                #include <linux/fs.h>
 
-               int set_acl_fn(struct inode *inode, struct posix_acl *acl,
+               static int set_acl_fn(struct inode *inode, struct posix_acl *acl,
                    int type) { return 0; }
 
                static const struct inode_operations
@@ -263,11 +296,25 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [
                AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
                AC_DEFINE(HAVE_SET_ACL_USERNS, 1, [iops->set_acl() takes 4 args])
        ],[
-               ZFS_LINUX_TEST_RESULT([inode_operations_set_acl], [
+               ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_mnt_idmap_dentry], [
                        AC_MSG_RESULT(yes)
-                       AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists, takes 3 args])
+                       AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
+                       AC_DEFINE(HAVE_SET_ACL_IDMAP_DENTRY, 1,
+                           [iops->set_acl() takes 4 args, arg1 is struct mnt_idmap *])
                ],[
-                       AC_MSG_RESULT(no)
+                       ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns_dentry], [
+                               AC_MSG_RESULT(yes)
+                               AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
+                               AC_DEFINE(HAVE_SET_ACL_USERNS_DENTRY_ARG2, 1,
+                                   [iops->set_acl() takes 4 args, arg2 is struct dentry *])
+                       ],[
+                               ZFS_LINUX_TEST_RESULT([inode_operations_set_acl], [
+                                       AC_MSG_RESULT(yes)
+                                       AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists, takes 3 args])
+                               ],[
+                                       ZFS_LINUX_REQUIRE_API([i_op->set_acl()], [3.14])
+                               ])
+                       ])
                ])
        ])
 ])