diff --git a/config/kernel-acl.m4 b/config/kernel-acl.m4 index 54c9401df..b1da74173 100644 --- a/config/kernel-acl.m4 +++ b/config/kernel-acl.m4 @@ -1,33 +1,3 @@ -dnl # -dnl # 3.14 API change, -dnl # set_cached_acl() and forget_cached_acl() changed from inline to -dnl # EXPORT_SYMBOL. In the former case, they may not be usable because of -dnl # posix_acl_release. In the latter case, we can always use them. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_SET_CACHED_ACL_USABLE], [ - ZFS_LINUX_TEST_SRC([set_cached_acl], [ - #include - #include - #include - ], [ - struct inode *ip = NULL; - struct posix_acl *acl = posix_acl_alloc(1, 0); - set_cached_acl(ip, ACL_TYPE_ACCESS, acl); - forget_cached_acl(ip, ACL_TYPE_ACCESS); - ], [], [ZFS_META_LICENSE]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE], [ - AC_MSG_CHECKING([whether set_cached_acl() is usable]) - ZFS_LINUX_TEST_RESULT([set_cached_acl_license], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SET_CACHED_ACL_USABLE, 1, - [set_cached_acl() is usable]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - dnl # dnl # 3.1 API change, dnl # posix_acl_equiv_mode now wants an umode_t instead of a mode_t @@ -281,7 +251,6 @@ AC_DEFUN([ZFS_AC_KERNEL_ACL_HAS_REFCOUNT], [ ]) AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL], [ - ZFS_AC_KERNEL_SRC_SET_CACHED_ACL_USABLE ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T ZFS_AC_KERNEL_SRC_POSIX_ACL_VALID_WITH_NS ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL @@ -291,7 +260,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL], [ ]) AC_DEFUN([ZFS_AC_KERNEL_ACL], [ - ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL diff --git a/include/os/linux/kernel/linux/vfs_compat.h b/include/os/linux/kernel/linux/vfs_compat.h index 4a5dc957c..1aa8ef1fd 100644 --- a/include/os/linux/kernel/linux/vfs_compat.h +++ b/include/os/linux/kernel/linux/vfs_compat.h @@ -190,43 +190,6 @@ zpl_posix_acl_release(struct posix_acl *acl) #endif } -#ifdef HAVE_SET_CACHED_ACL_USABLE -#define zpl_set_cached_acl(ip, ty, n) set_cached_acl(ip, ty, n) -#define zpl_forget_cached_acl(ip, ty) forget_cached_acl(ip, ty) -#else -static inline void -zpl_set_cached_acl(struct inode *ip, int type, struct posix_acl *newer) -{ - struct posix_acl *older = NULL; - - spin_lock(&ip->i_lock); - - if ((newer != ACL_NOT_CACHED) && (newer != NULL)) - posix_acl_dup(newer); - - switch (type) { - case ACL_TYPE_ACCESS: - older = ip->i_acl; - rcu_assign_pointer(ip->i_acl, newer); - break; - case ACL_TYPE_DEFAULT: - older = ip->i_default_acl; - rcu_assign_pointer(ip->i_default_acl, newer); - break; - } - - spin_unlock(&ip->i_lock); - - zpl_posix_acl_release(older); -} - -static inline void -zpl_forget_cached_acl(struct inode *ip, int type) -{ - zpl_set_cached_acl(ip, type, (struct posix_acl *)ACL_NOT_CACHED); -} -#endif /* HAVE_SET_CACHED_ACL_USABLE */ - /* * 4.8 API change, * posix_acl_valid() now must be passed a namespace, the namespace from diff --git a/module/os/linux/zfs/zpl_xattr.c b/module/os/linux/zfs/zpl_xattr.c index a1a7396c0..9c0559333 100644 --- a/module/os/linux/zfs/zpl_xattr.c +++ b/module/os/linux/zfs/zpl_xattr.c @@ -1049,9 +1049,9 @@ zpl_set_acl_impl(struct inode *ip, struct posix_acl *acl, int type) if (!error) { if (acl) - zpl_set_cached_acl(ip, type, acl); + set_cached_acl(ip, type, acl); else - zpl_forget_cached_acl(ip, type); + forget_cached_acl(ip, type); } return (error); @@ -1129,7 +1129,7 @@ zpl_get_acl_impl(struct inode *ip, int type) /* As of Linux 4.7, the kernel get_acl will set this for us */ #ifndef HAVE_KERNEL_GET_ACL_HANDLE_CACHE if (!IS_ERR(acl)) - zpl_set_cached_acl(ip, type, acl); + set_cached_acl(ip, type, acl); #endif return (acl);