mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 01:51:00 +03:00
config: remove HAVE_XATTR_(GET|SET|LIST)_HANDLER
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
79c307def9
commit
e6713cfd54
@ -49,18 +49,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_GET], [
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([xattr_handler_get_xattr_handler], [
|
||||
#include <linux/xattr.h>
|
||||
|
||||
static int get(const struct xattr_handler *handler,
|
||||
struct dentry *dentry, const char *name,
|
||||
void *buffer, size_t size) { 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>
|
||||
|
||||
@ -88,34 +76,19 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [
|
||||
[xattr_handler->get() wants both dentry and inode])
|
||||
],[
|
||||
dnl #
|
||||
dnl # 4.4 API change,
|
||||
dnl # The xattr_handler->get() callback was changed to take a
|
||||
dnl # attr_handler, and handler_flags argument was removed and
|
||||
dnl # should be accessed by handler->flags.
|
||||
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 xattr_handler])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_get_xattr_handler], [
|
||||
[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_HANDLER, 1,
|
||||
[xattr_handler->get() wants xattr_handler])
|
||||
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()])
|
||||
])
|
||||
])
|
||||
])
|
||||
@ -167,19 +140,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_SET], [
|
||||
.set = set,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([xattr_handler_set_xattr_handler], [
|
||||
#include <linux/xattr.h>
|
||||
|
||||
static int set(const struct xattr_handler *handler,
|
||||
struct dentry *dentry, const char *name,
|
||||
const void *buffer, size_t size, int flags)
|
||||
{ return 0; }
|
||||
static const struct xattr_handler
|
||||
xops __attribute__ ((unused)) = {
|
||||
.set = set,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
|
||||
@ -215,22 +175,7 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
|
||||
AC_DEFINE(HAVE_XATTR_SET_DENTRY_INODE, 1,
|
||||
[xattr_handler->set() wants both dentry and inode])
|
||||
],[
|
||||
dnl #
|
||||
dnl # 4.4 API change,
|
||||
dnl # The xattr_handler->set() callback was changed to take a
|
||||
dnl # xattr_handler, and handler_flags argument was removed and
|
||||
dnl # should be accessed by handler->flags.
|
||||
dnl #
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(
|
||||
[whether xattr_handler->set() wants xattr_handler])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_set_xattr_handler], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_XATTR_SET_HANDLER, 1,
|
||||
[xattr_handler->set() wants xattr_handler])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([xattr set()])
|
||||
])
|
||||
ZFS_LINUX_TEST_ERROR([xattr set()])
|
||||
])
|
||||
])
|
||||
])
|
||||
@ -249,18 +194,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_LIST], [
|
||||
.list = list,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([xattr_handler_list_xattr_handler], [
|
||||
#include <linux/xattr.h>
|
||||
|
||||
static size_t list(const struct xattr_handler *handler,
|
||||
struct dentry *dentry, char *list, size_t list_size,
|
||||
const char *name, size_t name_len) { return 0; }
|
||||
static const struct xattr_handler
|
||||
xops __attribute__ ((unused)) = {
|
||||
.list = list,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_LIST], [
|
||||
@ -273,22 +206,7 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_LIST], [
|
||||
AC_DEFINE(HAVE_XATTR_LIST_SIMPLE, 1,
|
||||
[xattr_handler->list() wants simple])
|
||||
],[
|
||||
dnl #
|
||||
dnl # 4.4 API change,
|
||||
dnl # The xattr_handler->list() callback was changed to take a
|
||||
dnl # xattr_handler, and handler_flags argument was removed
|
||||
dnl # and should be accessed by handler->flags.
|
||||
dnl #
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(
|
||||
[whether xattr_handler->list() wants xattr_handler])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_list_xattr_handler], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_XATTR_LIST_HANDLER, 1,
|
||||
[xattr_handler->list() wants xattr_handler])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([xattr list()])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
|
@ -47,15 +47,6 @@ fn(struct dentry *dentry) \
|
||||
{ \
|
||||
return (!!__ ## fn(dentry->d_inode, NULL, 0, NULL, 0)); \
|
||||
}
|
||||
#elif defined(HAVE_XATTR_LIST_HANDLER)
|
||||
#define ZPL_XATTR_LIST_WRAPPER(fn) \
|
||||
static size_t \
|
||||
fn(const struct xattr_handler *handler, struct dentry *dentry, \
|
||||
char *list, size_t list_size, const char *name, size_t name_len) \
|
||||
{ \
|
||||
return (__ ## fn(dentry->d_inode, \
|
||||
list, list_size, name, name_len)); \
|
||||
}
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#endif
|
||||
@ -73,20 +64,6 @@ fn(const struct xattr_handler *handler, struct dentry *dentry, \
|
||||
{ \
|
||||
return (__ ## fn(inode, name, buffer, size)); \
|
||||
}
|
||||
/*
|
||||
* 4.4 API change,
|
||||
* The xattr_handler->get() callback was changed to take a xattr_handler,
|
||||
* and handler_flags argument was removed and should be accessed by
|
||||
* handler->flags.
|
||||
*/
|
||||
#elif defined(HAVE_XATTR_GET_HANDLER)
|
||||
#define ZPL_XATTR_GET_WRAPPER(fn) \
|
||||
static int \
|
||||
fn(const struct xattr_handler *handler, struct dentry *dentry, \
|
||||
const char *name, void *buffer, size_t size) \
|
||||
{ \
|
||||
return (__ ## fn(dentry->d_inode, name, buffer, size)); \
|
||||
}
|
||||
/*
|
||||
* Android API change,
|
||||
* The xattr_handler->get() callback was changed to take a dentry and inode
|
||||
@ -149,21 +126,6 @@ fn(const struct xattr_handler *handler, struct dentry *dentry, \
|
||||
{ \
|
||||
return (__ ## fn(kcred->user_ns, inode, name, buffer, size, flags));\
|
||||
}
|
||||
/*
|
||||
* 4.4 API change,
|
||||
* The xattr_handler->set() callback was changed to take a xattr_handler,
|
||||
* and handler_flags argument was removed and should be accessed by
|
||||
* handler->flags.
|
||||
*/
|
||||
#elif defined(HAVE_XATTR_SET_HANDLER)
|
||||
#define ZPL_XATTR_SET_WRAPPER(fn) \
|
||||
static int \
|
||||
fn(const struct xattr_handler *handler, struct dentry *dentry, \
|
||||
const char *name, const void *buffer, size_t size, int flags) \
|
||||
{ \
|
||||
return (__ ## fn(kcred->user_ns, dentry->d_inode, name, \
|
||||
buffer, size, flags)); \
|
||||
}
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#endif
|
||||
|
@ -1363,8 +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) || \
|
||||
defined(HAVE_XATTR_LIST_HANDLER)
|
||||
#if defined(HAVE_XATTR_LIST_SIMPLE)
|
||||
.flags = ACL_TYPE_ACCESS,
|
||||
#endif
|
||||
};
|
||||
@ -1380,8 +1379,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) || \
|
||||
defined(HAVE_XATTR_LIST_HANDLER)
|
||||
#if defined(HAVE_XATTR_LIST_SIMPLE)
|
||||
.flags = ACL_TYPE_DEFAULT,
|
||||
#endif
|
||||
};
|
||||
@ -1451,9 +1449,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_HANDLER)
|
||||
if (!handler->list(handler, d, NULL, 0, name, name_len))
|
||||
return (XAPERM_DENY);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user