X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fxattr_compat.h;h=84d8fdeb89366d4002cf8083e62699581bd7e8fe;hb=e77aa730bc9d7ac80aac56b68f9cf7d51b275a29;hp=dfa92acab7073808962f6589f88404f4f657dc65;hpb=777d4af89137907adc91377327505f40c296035d;p=zfs.git diff --git a/include/linux/xattr_compat.h b/include/linux/xattr_compat.h index dfa92ac..84d8fde 100644 --- a/include/linux/xattr_compat.h +++ b/include/linux/xattr_compat.h @@ -39,4 +39,57 @@ 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 */ + +#ifdef HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY +#define zpl_security_inode_init_security(ip, dip, qstr, nm, val, len) \ + security_inode_init_security(ip, dip, qstr, nm, val, len) +#else +#define zpl_security_inode_init_security(ip, dip, qstr, nm, val, len) \ + security_inode_init_security(ip, dip, nm, val, len) +#endif /* HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY */ + #endif /* _ZFS_XATTR_H */