summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2016-06-01 18:10:06 -0700
committerBrian Behlendorf <[email protected]>2016-06-01 18:10:06 -0700
commit8fbbc6b4cf13f73d517ec4e826a7069a958fa5ba (patch)
tree0f40e772feaf1cddcb1e4d19313e86cf18e0c631 /include
parent6a7967253064a0b8711ca746a1296ee6439d36e6 (diff)
Linux 4.7 compat: handler->set() takes both dentry and inode
Counterpart to fd4c7b7, the same approach was taken to resolve the compatibility issue. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Closes #4717 Issue #4665
Diffstat (limited to 'include')
-rw-r--r--include/linux/xattr_compat.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/xattr_compat.h b/include/linux/xattr_compat.h
index 451b6545e..b1c429307 100644
--- a/include/linux/xattr_compat.h
+++ b/include/linux/xattr_compat.h
@@ -154,12 +154,26 @@ fn(struct inode *ip, const char *name, void *buffer, size_t size) \
#endif
/*
+ * 4.7 API change,
+ * The xattr_handler->set() callback was changed to take a both dentry and
+ * inode, because the dentry might not be attached to an inode yet.
+ */
+#if defined(HAVE_XATTR_SET_DENTRY_INODE)
+#define ZPL_XATTR_SET_WRAPPER(fn) \
+static int \
+fn(const struct xattr_handler *handler, struct dentry *dentry, \
+ struct inode *inode, const char *name, const void *buffer, \
+ size_t size, int flags) \
+{ \
+ return (__ ## fn(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.
*/
-#if defined(HAVE_XATTR_SET_HANDLER)
+#elif defined(HAVE_XATTR_SET_HANDLER)
#define ZPL_XATTR_SET_WRAPPER(fn) \
static int \
fn(const struct xattr_handler *handler, struct dentry *dentry, \