diff options
author | Chunwei Chen <[email protected]> | 2015-11-23 15:06:46 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-12-04 14:59:10 -0800 |
commit | 15126e5d08d54643ee2e433849795c4b2c4e5f45 (patch) | |
tree | 03c8b11b0f590e392500a7538b90e2023d1117ea /include | |
parent | e909a45d22be9645f8bca27bfc4db6912648e1be (diff) |
Linux 4.4 compat: xattr operations takes xattr_handler
The xattr_hander->{list,get,set} were changed to take a xattr_handler,
and handler_flags argument was removed and should be accessed by
handler->flags.
Signed-off-by: Chunwei Chen <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #4021
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/xattr_compat.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/xattr_compat.h b/include/linux/xattr_compat.h index a7371f946..28eff95fa 100644 --- a/include/linux/xattr_compat.h +++ b/include/linux/xattr_compat.h @@ -54,6 +54,20 @@ fn(struct dentry *dentry, const char *name, void *buffer, size_t size, \ { \ return (__ ## fn(dentry->d_inode, name, buffer, size)); \ } +/* + * 4.4 API change, + * The xattr_hander->get() callback was changed to take a xattr_handler, + * and handler_flags argument was removed and should be accessed by + * handler->flags. + */ +#elif defined(HAVE_HANDLER_XATTR_GET) +#define ZPL_XATTR_GET_WRAPPER(fn) \ +static int \ +fn(const struct xattr_handler *handler, struct dentry *dentry, \ + const char *name, void *buffer, size_t size) \ +{ \ + return (__ ## fn(dentry->d_inode, name, buffer, size)); \ +} #else #define ZPL_XATTR_GET_WRAPPER(fn) \ static int \ @@ -76,6 +90,20 @@ fn(struct dentry *dentry, const char *name, const void *buffer, \ { \ return (__ ## fn(dentry->d_inode, name, buffer, size, flags)); \ } +/* + * 4.4 API change, + * The xattr_hander->set() callback was changed to take a xattr_handler, + * and handler_flags argument was removed and should be accessed by + * handler->flags. + */ +#elif defined(HAVE_HANDLER_XATTR_SET) +#define ZPL_XATTR_SET_WRAPPER(fn) \ +static int \ +fn(const struct xattr_handler *handler, struct dentry *dentry, \ + const char *name, const void *buffer, size_t size, int flags) \ +{ \ + return (__ ## fn(dentry->d_inode, name, buffer, size, flags)); \ +} #else #define ZPL_XATTR_SET_WRAPPER(fn) \ static int \ |