diff options
-rw-r--r-- | config/kernel-xattr-handler.m4 | 100 | ||||
-rw-r--r-- | include/os/linux/kernel/linux/xattr_compat.h | 38 | ||||
-rw-r--r-- | module/os/linux/zfs/zpl_xattr.c | 9 |
3 files changed, 11 insertions, 136 deletions
diff --git a/config/kernel-xattr-handler.m4 b/config/kernel-xattr-handler.m4 index d85f6e5b2..2e60f8f57 100644 --- a/config/kernel-xattr-handler.m4 +++ b/config/kernel-xattr-handler.m4 @@ -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()]) - ]) ]) ]) diff --git a/include/os/linux/kernel/linux/xattr_compat.h b/include/os/linux/kernel/linux/xattr_compat.h index b3761a422..956c2b73d 100644 --- a/include/os/linux/kernel/linux/xattr_compat.h +++ b/include/os/linux/kernel/linux/xattr_compat.h @@ -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 @@ -74,20 +65,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 * and flags, because the dentry might not be attached to an inode yet. @@ -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 diff --git a/module/os/linux/zfs/zpl_xattr.c b/module/os/linux/zfs/zpl_xattr.c index bd313d36a..183160ead 100644 --- a/module/os/linux/zfs/zpl_xattr.c +++ b/module/os/linux/zfs/zpl_xattr.c @@ -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 } |