aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-02-11 10:33:01 -0800
committerBrian Behlendorf <[email protected]>2011-02-11 10:41:00 -0800
commitf9637c6c8b9c452c440a366aa937b363f027d95e (patch)
tree3d2a3c0e58753715c8f603beb25351f74d76c76b /include
parent7268e1bec8478639b7a1047e02ab931f30bc2f92 (diff)
Linux 2.6.33 compat, get/set xattr callbacks
The xattr handler prototypes were sanitized with the idea being that the same handlers could be used for multiple methods. The result of this was the inode type was changes to a dentry, and both the get() and set() hooks had a handler_flags argument added. The list() callback was similiarly effected but no autoconf check was added because we do not use the list() callback.
Diffstat (limited to 'include')
-rw-r--r--include/linux/xattr_compat.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/linux/xattr_compat.h b/include/linux/xattr_compat.h
index dfa92acab..9878aab72 100644
--- a/include/linux/xattr_compat.h
+++ b/include/linux/xattr_compat.h
@@ -39,4 +39,49 @@ typedef const struct xattr_handler xattr_handler_t;
typedef struct xattr_handler xattr_handler_t;
#endif
+/*
+ * 2.6.33 API change,
+ * The xattr_hander->get() callback was changed to take a dentry
+ * instead of an inode, and a handler_flags argument was added.
+ */
+#ifdef HAVE_DENTRY_XATTR_GET
+#define ZPL_XATTR_GET_WRAPPER(fn) \
+static int \
+fn(struct dentry *dentry, const char *name, void *buffer, size_t size, \
+ int unused_handler_flags) \
+{ \
+ return __ ## fn(dentry->d_inode, name, buffer, size); \
+}
+#else
+#define ZPL_XATTR_GET_WRAPPER(fn) \
+static int \
+fn(struct inode *ip, const char *name, void *buffer, size_t size) \
+{ \
+ return __ ## fn(ip, name, buffer, size); \
+}
+#endif /* HAVE_DENTRY_XATTR_GET */
+
+/*
+ * 2.6.33 API change,
+ * The xattr_hander->set() callback was changed to take a dentry
+ * instead of an inode, and a handler_flags argument was added.
+ */
+#ifdef HAVE_DENTRY_XATTR_SET
+#define ZPL_XATTR_SET_WRAPPER(fn) \
+static int \
+fn(struct dentry *dentry, const char *name, const void *buffer, \
+ size_t size, int flags, int unused_handler_flags) \
+{ \
+ return __ ## fn(dentry->d_inode, name, buffer, size, flags); \
+}
+#else
+#define ZPL_XATTR_SET_WRAPPER(fn) \
+static int \
+fn(struct inode *ip, const char *name, const void *buffer, \
+ size_t size, int flags) \
+{ \
+ return __ ## fn(ip, name, buffer, size, flags); \
+}
+#endif /* HAVE_DENTRY_XATTR_SET */
+
#endif /* _ZFS_XATTR_H */