mirror of
				https://git.proxmox.com/git/mirror_zfs
				synced 2025-10-31 15:26:31 +00:00 
			
		
		
		
	config: remove HAVE_SET_CACHED_ACL_USABLE
Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #16479
This commit is contained in:
		
							parent
							
								
									6840e3b18b
								
							
						
					
					
						commit
						d60d4ad809
					
				| @ -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 <linux/cred.h> | ||||
| 		#include <linux/fs.h> | ||||
| 		#include <linux/posix_acl.h> | ||||
| 	], [ | ||||
| 		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 | ||||
|  | ||||
| @ -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 | ||||
|  | ||||
| @ -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); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Rob Norris
						Rob Norris