]> git.proxmox.com Git - mirror_zfs-debian.git/blobdiff - include/linux/xattr_compat.h
Imported Upstream version 0.6.5.8
[mirror_zfs-debian.git] / include / linux / xattr_compat.h
index 5e19ea1e5cc95384f707bbf468ec8e544bcb3a66..b1c4293077c8489dc255b37871533f0bee7712b6 100644 (file)
@@ -101,13 +101,26 @@ 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,         \
@@ -140,13 +153,27 @@ 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,         \