config: remove HAVE_XATTR_(GET|SET|LIST)_DENTRY

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:
Rob Norris 2024-08-05 19:47:27 +10:00 committed by Brian Behlendorf
parent eb73000dbb
commit 733317966f
3 changed files with 10 additions and 139 deletions

View File

@ -89,18 +89,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_GET], [
};
],[])
ZFS_LINUX_TEST_SRC([xattr_handler_get_dentry], [
#include <linux/xattr.h>
static int get(struct dentry *dentry, const char *name,
void *buffer, size_t size, int handler_flags)
{ return 0; }
static const struct xattr_handler
xops __attribute__ ((unused)) = {
.get = get,
};
],[])
ZFS_LINUX_TEST_SRC([xattr_handler_get_dentry_inode_flags], [
#include <linux/xattr.h>
@ -142,34 +130,19 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [
[xattr_handler->get() wants xattr_handler])
],[
dnl #
dnl # 2.6.33 API change,
dnl # The xattr_handler->get() callback was changed
dnl # to take a dentry instead of an inode, and a
dnl # handler_flags argument was added.
dnl # Android API change,
dnl # The xattr_handler->get() callback was
dnl # changed to take dentry, inode and flags.
dnl #
AC_MSG_RESULT(no)
AC_MSG_CHECKING(
[whether xattr_handler->get() wants dentry])
ZFS_LINUX_TEST_RESULT([xattr_handler_get_dentry], [
[whether xattr_handler->get() wants dentry and inode and flags])
ZFS_LINUX_TEST_RESULT([xattr_handler_get_dentry_inode_flags], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_XATTR_GET_DENTRY, 1,
[xattr_handler->get() wants dentry])
AC_DEFINE(HAVE_XATTR_GET_DENTRY_INODE_FLAGS, 1,
[xattr_handler->get() wants dentry and inode and flags])
],[
dnl #
dnl # Android API change,
dnl # The xattr_handler->get() callback was
dnl # changed to take dentry, inode and flags.
dnl #
AC_MSG_RESULT(no)
AC_MSG_CHECKING(
[whether xattr_handler->get() wants dentry and inode and flags])
ZFS_LINUX_TEST_RESULT([xattr_handler_get_dentry_inode_flags], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_XATTR_GET_DENTRY_INODE_FLAGS, 1,
[xattr_handler->get() wants dentry and inode and flags])
],[
ZFS_LINUX_TEST_ERROR([xattr get()])
])
ZFS_LINUX_TEST_ERROR([xattr get()])
])
])
])
@ -235,18 +208,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_SET], [
.set = set,
};
],[])
ZFS_LINUX_TEST_SRC([xattr_handler_set_dentry], [
#include <linux/xattr.h>
static int set(struct dentry *dentry, const char *name,
const void *buffer, size_t size, int flags,
int handler_flags) { return 0; }
static const struct xattr_handler
xops __attribute__ ((unused)) = {
.set = set,
};
],[])
])
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
@ -296,22 +257,7 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
AC_DEFINE(HAVE_XATTR_SET_HANDLER, 1,
[xattr_handler->set() wants xattr_handler])
],[
dnl #
dnl # 2.6.33 API change,
dnl # The xattr_handler->set() callback was changed
dnl # to take a dentry instead of an inode, and a
dnl # handler_flags argument was added.
dnl #
AC_MSG_RESULT(no)
AC_MSG_CHECKING(
[whether xattr_handler->set() wants dentry])
ZFS_LINUX_TEST_RESULT([xattr_handler_set_dentry], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_XATTR_SET_DENTRY, 1,
[xattr_handler->set() wants dentry])
],[
ZFS_LINUX_TEST_ERROR([xattr set()])
])
ZFS_LINUX_TEST_ERROR([xattr set()])
])
])
])
@ -343,19 +289,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_LIST], [
.list = list,
};
],[])
ZFS_LINUX_TEST_SRC([xattr_handler_list_dentry], [
#include <linux/xattr.h>
static size_t list(struct dentry *dentry,
char *list, size_t list_size,
const char *name, size_t name_len,
int handler_flags) { return 0; }
static const struct xattr_handler
xops __attribute__ ((unused)) = {
.list = list,
};
],[])
])
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_LIST], [
@ -382,22 +315,7 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_LIST], [
AC_DEFINE(HAVE_XATTR_LIST_HANDLER, 1,
[xattr_handler->list() wants xattr_handler])
],[
dnl #
dnl # 2.6.33 API change,
dnl # The xattr_handler->list() callback was changed
dnl # to take a dentry instead of an inode, and a
dnl # handler_flags argument was added.
dnl #
AC_MSG_RESULT(no)
AC_MSG_CHECKING(
[whether xattr_handler->list() wants dentry])
ZFS_LINUX_TEST_RESULT([xattr_handler_list_dentry], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_XATTR_LIST_DENTRY, 1,
[xattr_handler->list() wants dentry])
],[
ZFS_LINUX_TEST_ERROR([xattr list()])
])
ZFS_LINUX_TEST_ERROR([xattr list()])
])
])
])

View File

@ -47,21 +47,6 @@ fn(struct dentry *dentry) \
{ \
return (!!__ ## fn(dentry->d_inode, NULL, 0, NULL, 0)); \
}
/*
* 4.4 API change,
*/
#elif defined(HAVE_XATTR_LIST_DENTRY)
#define ZPL_XATTR_LIST_WRAPPER(fn) \
static size_t \
fn(struct dentry *dentry, char *list, size_t list_size, \
const char *name, size_t name_len, int type) \
{ \
return (__ ## fn(dentry->d_inode, \
list, list_size, name, name_len)); \
}
/*
* 2.6.33 API change,
*/
#elif defined(HAVE_XATTR_LIST_HANDLER)
#define ZPL_XATTR_LIST_WRAPPER(fn) \
static size_t \
@ -102,19 +87,6 @@ fn(const struct xattr_handler *handler, struct dentry *dentry, \
{ \
return (__ ## fn(dentry->d_inode, name, buffer, size)); \
}
/*
* 2.6.33 API change,
* The xattr_handler->get() callback was changed to take a dentry
* instead of an inode, and a handler_flags argument was added.
*/
#elif defined(HAVE_XATTR_GET_DENTRY)
#define ZPL_XATTR_GET_WRAPPER(fn) \
static int \
fn(struct dentry *dentry, const char *name, void *buffer, size_t size, \
int unused_handler_flags) \
{ \
return (__ ## fn(dentry->d_inode, name, buffer, size)); \
}
/*
* Android API change,
* The xattr_handler->get() callback was changed to take a dentry and inode
@ -192,20 +164,6 @@ fn(const struct xattr_handler *handler, struct dentry *dentry, \
return (__ ## fn(kcred->user_ns, dentry->d_inode, name, \
buffer, size, flags)); \
}
/*
* 2.6.33 API change,
* The xattr_handler->set() callback was changed to take a dentry
* instead of an inode, and a handler_flags argument was added.
*/
#elif defined(HAVE_XATTR_SET_DENTRY)
#define ZPL_XATTR_SET_WRAPPER(fn) \
static int \
fn(struct dentry *dentry, const char *name, const void *buffer, \
size_t size, int flags, int unused_handler_flags) \
{ \
return (__ ## fn(kcred->user_ns, dentry->d_inode, name, \
buffer, size, flags)); \
}
#else
#error "Unsupported kernel"
#endif

View File

@ -1425,7 +1425,6 @@ static xattr_handler_t zpl_xattr_acl_access_handler = {
.get = zpl_xattr_acl_get_access,
.set = zpl_xattr_acl_set_access,
#if defined(HAVE_XATTR_LIST_SIMPLE) || \
defined(HAVE_XATTR_LIST_DENTRY) || \
defined(HAVE_XATTR_LIST_HANDLER)
.flags = ACL_TYPE_ACCESS,
#endif
@ -1447,7 +1446,6 @@ static xattr_handler_t zpl_xattr_acl_default_handler = {
.get = zpl_xattr_acl_get_default,
.set = zpl_xattr_acl_set_default,
#if defined(HAVE_XATTR_LIST_SIMPLE) || \
defined(HAVE_XATTR_LIST_DENTRY) || \
defined(HAVE_XATTR_LIST_HANDLER)
.flags = ACL_TYPE_DEFAULT,
#endif
@ -1518,9 +1516,6 @@ zpl_xattr_permission(xattr_filldir_t *xf, const char *name, int name_len)
#if defined(HAVE_XATTR_LIST_SIMPLE)
if (!handler->list(d))
return (XAPERM_DENY);
#elif defined(HAVE_XATTR_LIST_DENTRY)
if (!handler->list(d, NULL, 0, name, name_len, 0))
return (XAPERM_DENY);
#elif defined(HAVE_XATTR_LIST_HANDLER)
if (!handler->list(handler, d, NULL, 0, name, name_len))
return (XAPERM_DENY);