diff options
Diffstat (limited to 'include/linux/xattr_compat.h')
-rw-r--r-- | include/linux/xattr_compat.h | 16 |
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, \ |