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 <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #4021
This commit is contained in:
Chunwei Chen
2015-11-23 15:06:46 -08:00
committed by Brian Behlendorf
parent 1a09371678
commit 61d482f7cd
3 changed files with 164 additions and 2 deletions
+28
View File
@@ -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 \