aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChunwei Chen <[email protected]>2016-05-18 13:44:13 -0700
committerBrian Behlendorf <[email protected]>2016-05-20 11:08:21 -0700
commitfd4c7b7a73fda391f94f58530c86ffa5b2ef8e6f (patch)
tree3b964c41866a313aaeaacb1be42363374324bcb6 /include
parent278f2236688e70f4097e62ae93537c69968be027 (diff)
Linux 4.7 compat: handler->get() takes both dentry and inode
Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #4665
Diffstat (limited to 'include')
-rw-r--r--include/linux/xattr_compat.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/linux/xattr_compat.h b/include/linux/xattr_compat.h
index 5e19ea1e5..451b6545e 100644
--- a/include/linux/xattr_compat.h
+++ b/include/linux/xattr_compat.h
@@ -102,12 +102,25 @@ fn(struct inode *ip, char *list, size_t list_size, \
#endif
/*
+ * 4.7 API change,
+ * The xattr_handler->get() 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_GET_DENTRY_INODE)
+#define ZPL_XATTR_GET_WRAPPER(fn) \
+static int \
+fn(const struct xattr_handler *handler, struct dentry *dentry, \
+ struct inode *inode, const char *name, void *buffer, size_t size) \
+{ \
+ 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.
*/
-#if defined(HAVE_XATTR_GET_HANDLER)
+#elif defined(HAVE_XATTR_GET_HANDLER)
#define ZPL_XATTR_GET_WRAPPER(fn) \
static int \
fn(const struct xattr_handler *handler, struct dentry *dentry, \