From e055f0e0532efef6ad38d0551c6009b11ad50313 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Fri, 16 Aug 2024 18:19:35 +1000 Subject: [PATCH] config: remove HAVE_XATTR_LIST_SIMPLE 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-xattr-handler.m4 | 31 -------------------- include/os/linux/kernel/linux/xattr_compat.h | 4 --- module/os/linux/zfs/zpl_xattr.c | 6 ---- 3 files changed, 41 deletions(-) diff --git a/config/kernel-xattr-handler.m4 b/config/kernel-xattr-handler.m4 index 2e60f8f57..f83e33b00 100644 --- a/config/kernel-xattr-handler.m4 +++ b/config/kernel-xattr-handler.m4 @@ -181,35 +181,6 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [ ]) ]) -dnl # -dnl # Supported xattr handler list() interfaces checked newest to oldest. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_LIST], [ - ZFS_LINUX_TEST_SRC([xattr_handler_list_simple], [ - #include - - static bool list(struct dentry *dentry) { return 0; } - static const struct xattr_handler - xops __attribute__ ((unused)) = { - .list = list, - }; - ],[]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_LIST], [ - dnl # 4.5 API change, - dnl # The xattr_handler->list() callback was changed to take only a - dnl # dentry and it only needs to return if it's accessible. - AC_MSG_CHECKING([whether xattr_handler->list() wants simple]) - ZFS_LINUX_TEST_RESULT([xattr_handler_list_simple], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_XATTR_LIST_SIMPLE, 1, - [xattr_handler->list() wants simple]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - dnl # dnl # 4.9 API change, dnl # iops->{set,get,remove}xattr and generic_{set,get,remove}xattr are @@ -242,7 +213,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR], [ ZFS_AC_KERNEL_SRC_CONST_XATTR_HANDLER ZFS_AC_KERNEL_SRC_XATTR_HANDLER_GET ZFS_AC_KERNEL_SRC_XATTR_HANDLER_SET - ZFS_AC_KERNEL_SRC_XATTR_HANDLER_LIST ZFS_AC_KERNEL_SRC_GENERIC_SETXATTR ]) @@ -250,6 +220,5 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR], [ ZFS_AC_KERNEL_CONST_XATTR_HANDLER ZFS_AC_KERNEL_XATTR_HANDLER_GET ZFS_AC_KERNEL_XATTR_HANDLER_SET - ZFS_AC_KERNEL_XATTR_HANDLER_LIST ZFS_AC_KERNEL_GENERIC_SETXATTR ]) diff --git a/include/os/linux/kernel/linux/xattr_compat.h b/include/os/linux/kernel/linux/xattr_compat.h index 956c2b73d..9f3b78a7e 100644 --- a/include/os/linux/kernel/linux/xattr_compat.h +++ b/include/os/linux/kernel/linux/xattr_compat.h @@ -40,16 +40,12 @@ typedef const struct xattr_handler xattr_handler_t; /* * 4.5 API change, */ -#if defined(HAVE_XATTR_LIST_SIMPLE) #define ZPL_XATTR_LIST_WRAPPER(fn) \ static bool \ fn(struct dentry *dentry) \ { \ return (!!__ ## fn(dentry->d_inode, NULL, 0, NULL, 0)); \ } -#else -#error "Unsupported kernel" -#endif /* * 4.7 API change, diff --git a/module/os/linux/zfs/zpl_xattr.c b/module/os/linux/zfs/zpl_xattr.c index 183160ead..958af83ef 100644 --- a/module/os/linux/zfs/zpl_xattr.c +++ b/module/os/linux/zfs/zpl_xattr.c @@ -1363,9 +1363,7 @@ static xattr_handler_t zpl_xattr_acl_access_handler = { .list = zpl_xattr_acl_list_access, .get = zpl_xattr_acl_get_access, .set = zpl_xattr_acl_set_access, -#if defined(HAVE_XATTR_LIST_SIMPLE) .flags = ACL_TYPE_ACCESS, -#endif }; /* @@ -1379,9 +1377,7 @@ static xattr_handler_t zpl_xattr_acl_default_handler = { .list = zpl_xattr_acl_list_default, .get = zpl_xattr_acl_get_default, .set = zpl_xattr_acl_set_default, -#if defined(HAVE_XATTR_LIST_SIMPLE) .flags = ACL_TYPE_DEFAULT, -#endif }; #endif /* CONFIG_FS_POSIX_ACL */ @@ -1446,10 +1442,8 @@ zpl_xattr_permission(xattr_filldir_t *xf, const char *name, int name_len) } if (handler->list) { -#if defined(HAVE_XATTR_LIST_SIMPLE) if (!handler->list(d)) return (XAPERM_DENY); -#endif } return (perm);