summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChunwei Chen <[email protected]>2016-05-18 13:44:13 -0700
committerNed Bass <[email protected]>2016-09-05 16:07:08 -0700
commit55b8857346b921dae82231612b253029a1944609 (patch)
tree2bfd8958661098ebf757a026be91f321dbdca881 /include
parent703c9f5893f6b137b723ed819d61bc5fa9140954 (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, \