])
])
-dnl #
-dnl # 3.14 API change,
-dnl # Check if inode_operations contains the function set_acl
dnl #
dnl # 5.12 API change,
dnl # set_acl() added a user_namespace* parameter first
])
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [
- AC_MSG_CHECKING([whether iops->set_acl() exists])
+ AC_MSG_CHECKING([whether iops->set_acl() with 4 args exists])
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns], [
AC_MSG_RESULT(yes)
- 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_mnt_idmap_dentry], [
AC_MSG_RESULT(yes)
- 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 *])
],[
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])
- ])
+ AC_MSG_RESULT(no)
])
])
])
extern ssize_t zpl_xattr_list(struct dentry *dentry, char *buf, size_t size);
extern int zpl_xattr_security_init(struct inode *ip, struct inode *dip,
const struct qstr *qstr);
+
#if defined(CONFIG_FS_POSIX_ACL)
-#if defined(HAVE_SET_ACL)
+
#if defined(HAVE_SET_ACL_IDMAP_DENTRY)
extern int zpl_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
#else
extern int zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type);
#endif /* HAVE_SET_ACL_USERNS */
-#endif /* HAVE_SET_ACL */
+
#if defined(HAVE_GET_ACL_RCU) || defined(HAVE_GET_INODE_ACL)
extern struct posix_acl *zpl_get_acl(struct inode *ip, int type, bool rcu);
#elif defined(HAVE_GET_ACL)
#endif
.listxattr = zpl_xattr_list,
#if defined(CONFIG_FS_POSIX_ACL)
-#if defined(HAVE_SET_ACL)
.set_acl = zpl_set_acl,
-#endif /* HAVE_SET_ACL */
#if defined(HAVE_GET_INODE_ACL)
.get_inode_acl = zpl_get_acl,
#else
#endif
.listxattr = zpl_xattr_list,
#if defined(CONFIG_FS_POSIX_ACL)
-#if defined(HAVE_SET_ACL)
.set_acl = zpl_set_acl,
-#endif /* HAVE_SET_ACL */
#if defined(HAVE_GET_INODE_ACL)
.get_inode_acl = zpl_get_acl,
#else
#endif
.listxattr = zpl_xattr_list,
#if defined(CONFIG_FS_POSIX_ACL)
-#if defined(HAVE_SET_ACL)
.set_acl = zpl_set_acl,
-#endif /* HAVE_SET_ACL */
#if defined(HAVE_GET_INODE_ACL)
.get_inode_acl = zpl_get_acl,
#else
return (error);
}
-#ifdef HAVE_SET_ACL
int
#ifdef HAVE_SET_ACL_USERNS
zpl_set_acl(struct user_namespace *userns, struct inode *ip,
return (zpl_set_acl_impl(ip, acl, type));
#endif /* HAVE_SET_ACL_USERNS_DENTRY_ARG2 */
}
-#endif /* HAVE_SET_ACL */
static struct posix_acl *
zpl_get_acl_impl(struct inode *ip, int type)