summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorChunwei Chen <[email protected]>2015-11-23 15:06:46 -0800
committerBrian Behlendorf <[email protected]>2015-12-01 16:48:25 -0800
commit61d482f7cd1687177185140699c6843c904b38d4 (patch)
tree3240dbdd43598b72269d236be575e5a0ab7a369c /config
parent1a093716788a08b5d038c49ab99a6e9363c97a64 (diff)
Linux 4.4 compat: xattr operations takes xattr_handler
The xattr_hander->{list,get,set} were changed to take a xattr_handler, and handler_flags argument was removed and should be accessed by handler->flags. Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #4021
Diffstat (limited to 'config')
-rw-r--r--config/kernel-xattr-handler.m469
1 files changed, 69 insertions, 0 deletions
diff --git a/config/kernel-xattr-handler.m4 b/config/kernel-xattr-handler.m4
index 1374f7917..d79a6e47b 100644
--- a/config/kernel-xattr-handler.m4
+++ b/config/kernel-xattr-handler.m4
@@ -37,6 +37,11 @@ dnl # 2.6.33 API change,
dnl # The xattr_hander->get() callback was changed to take a dentry
dnl # instead of an inode, and a handler_flags argument was added.
dnl #
+dnl # 4.4 API change,
+dnl # The xattr_hander->get() callback was changed to take a xattr_handler,
+dnl # and handler_flags argument was removed and should be accessed by
+dnl # handler->flags.
+dnl #
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [
AC_MSG_CHECKING([whether xattr_handler->get() wants dentry])
ZFS_LINUX_TRY_COMPILE([
@@ -55,6 +60,24 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [
[xattr_handler->get() wants dentry])
],[
AC_MSG_RESULT(no)
+ AC_MSG_CHECKING([whether xattr_handler->get() wants xattr_handler])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/xattr.h>
+
+ 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,
+ };
+ ],[
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_HANDLER_XATTR_GET, 1,
+ [xattr_handler->get() wants xattr_handler])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
])
])
@@ -63,6 +86,11 @@ dnl # 2.6.33 API change,
dnl # The xattr_hander->set() callback was changed to take a dentry
dnl # instead of an inode, and a handler_flags argument was added.
dnl #
+dnl # 4.4 API change,
+dnl # The xattr_hander->set() callback was changed to take a xattr_handler,
+dnl # and handler_flags argument was removed and should be accessed by
+dnl # handler->flags.
+dnl #
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
AC_MSG_CHECKING([whether xattr_handler->set() wants dentry])
ZFS_LINUX_TRY_COMPILE([
@@ -82,6 +110,24 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
[xattr_handler->set() wants dentry])
],[
AC_MSG_RESULT(no)
+ AC_MSG_CHECKING([whether xattr_handler->set() wants xattr_handler])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/xattr.h>
+
+ 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_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_HANDLER_XATTR_SET, 1,
+ [xattr_handler->set() wants xattr_handler])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
])
])
@@ -90,6 +136,11 @@ dnl # 2.6.33 API change,
dnl # The xattr_hander->list() callback was changed to take a dentry
dnl # instead of an inode, and a handler_flags argument was added.
dnl #
+dnl # 4.4 API change,
+dnl # The xattr_hander->list() callback was changed to take a xattr_handler,
+dnl # and handler_flags argument was removed and should be accessed by
+dnl # handler->flags.
+dnl #
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_LIST], [
AC_MSG_CHECKING([whether xattr_handler->list() wants dentry])
ZFS_LINUX_TRY_COMPILE([
@@ -109,6 +160,24 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_LIST], [
[xattr_handler->list() wants dentry])
],[
AC_MSG_RESULT(no)
+ AC_MSG_CHECKING([whether xattr_handler->list() wants xattr_handler])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/xattr.h>
+
+ 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_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_HANDLER_XATTR_LIST, 1,
+ [xattr_handler->list() wants xattr_handler])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
])
])