summaryrefslogtreecommitdiffstats
path: root/include/linux/xattr_compat.h
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 /include/linux/xattr_compat.h
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 'include/linux/xattr_compat.h')
-rw-r--r--include/linux/xattr_compat.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/xattr_compat.h b/include/linux/xattr_compat.h
index a7371f946..28eff95fa 100644
--- a/include/linux/xattr_compat.h
+++ b/include/linux/xattr_compat.h
@@ -54,6 +54,20 @@ fn(struct dentry *dentry, const char *name, void *buffer, size_t size, \
{ \
return (__ ## fn(dentry->d_inode, name, buffer, size)); \
}
+/*
+ * 4.4 API change,
+ * The xattr_hander->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_HANDLER_XATTR_GET)
+#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)); \
+}
#else
#define ZPL_XATTR_GET_WRAPPER(fn) \
static int \
@@ -76,6 +90,20 @@ fn(struct dentry *dentry, const char *name, const void *buffer, \
{ \
return (__ ## fn(dentry->d_inode, name, buffer, size, flags)); \
}
+/*
+ * 4.4 API change,
+ * The xattr_hander->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_HANDLER_XATTR_SET)
+#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(dentry->d_inode, name, buffer, size, flags)); \
+}
#else
#define ZPL_XATTR_SET_WRAPPER(fn) \
static int \