From e954f086e0c96c3e8df74576ee03ca1aee323b88 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Sun, 4 Aug 2024 09:47:34 +1000 Subject: [PATCH] config: remove HAVE_SET_ACL Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf Reviewed-by: Tony Hutter Reviewed-by: Tino Reichardt Signed-off-by: Rob Norris Closes #16479 --- config/kernel-acl.m4 | 15 ++------------- include/os/linux/zfs/sys/zpl.h | 5 +++-- module/os/linux/zfs/zpl_inode.c | 6 ------ module/os/linux/zfs/zpl_xattr.c | 2 -- 4 files changed, 5 insertions(+), 23 deletions(-) diff --git a/config/kernel-acl.m4 b/config/kernel-acl.m4 index dedbb844b..54c9401df 100644 --- a/config/kernel-acl.m4 +++ b/config/kernel-acl.m4 @@ -147,9 +147,6 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [ ]) ]) -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 @@ -211,30 +208,22 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [ ]) 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) ]) ]) ]) diff --git a/include/os/linux/zfs/sys/zpl.h b/include/os/linux/zfs/sys/zpl.h index 91a4751ff..e93901b3e 100644 --- a/include/os/linux/zfs/sys/zpl.h +++ b/include/os/linux/zfs/sys/zpl.h @@ -70,8 +70,9 @@ extern struct file_system_type zpl_fs_type; 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); @@ -84,7 +85,7 @@ extern int zpl_set_acl(struct user_namespace *userns, struct dentry *dentry, #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) diff --git a/module/os/linux/zfs/zpl_inode.c b/module/os/linux/zfs/zpl_inode.c index ad1753f7a..059f74786 100644 --- a/module/os/linux/zfs/zpl_inode.c +++ b/module/os/linux/zfs/zpl_inode.c @@ -807,9 +807,7 @@ const struct inode_operations zpl_inode_operations = { #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 @@ -853,9 +851,7 @@ const struct inode_operations zpl_dir_inode_operations = { #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 @@ -900,9 +896,7 @@ const struct inode_operations zpl_special_inode_operations = { #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 diff --git a/module/os/linux/zfs/zpl_xattr.c b/module/os/linux/zfs/zpl_xattr.c index 689de19fb..a1a7396c0 100644 --- a/module/os/linux/zfs/zpl_xattr.c +++ b/module/os/linux/zfs/zpl_xattr.c @@ -1057,7 +1057,6 @@ zpl_set_acl_impl(struct inode *ip, struct posix_acl *acl, int type) return (error); } -#ifdef HAVE_SET_ACL int #ifdef HAVE_SET_ACL_USERNS zpl_set_acl(struct user_namespace *userns, struct inode *ip, @@ -1080,7 +1079,6 @@ zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type) 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)