diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/zfs/zpl_xattr.c | 69 |
1 files changed, 67 insertions, 2 deletions
diff --git a/module/zfs/zpl_xattr.c b/module/zfs/zpl_xattr.c index 202199c6d..d224078ef 100644 --- a/module/zfs/zpl_xattr.c +++ b/module/zfs/zpl_xattr.c @@ -1022,6 +1022,29 @@ zpl_xattr_acl_list_default(struct dentry *dentry, char *list, list, list_size, name, name_len, type); } +#elif defined(HAVE_HANDLER_XATTR_LIST) +static size_t +zpl_xattr_acl_list_access(const struct xattr_handler *handler, + struct dentry *dentry, char *list, size_t list_size, const char *name, + size_t name_len) +{ + int type = handler->flags; + ASSERT3S(type, ==, ACL_TYPE_ACCESS); + return zpl_xattr_acl_list(dentry->d_inode, + list, list_size, name, name_len, type); +} + +static size_t +zpl_xattr_acl_list_default(const struct xattr_handler *handler, + struct dentry *dentry, char *list, size_t list_size, const char *name, + size_t name_len) +{ + int type = handler->flags; + ASSERT3S(type, ==, ACL_TYPE_DEFAULT); + return zpl_xattr_acl_list(dentry->d_inode, + list, list_size, name, name_len, type); +} + #else static size_t @@ -1083,6 +1106,25 @@ zpl_xattr_acl_get_default(struct dentry *dentry, const char *name, return (zpl_xattr_acl_get(dentry->d_inode, name, buffer, size, type)); } +#elif defined(HAVE_HANDLER_XATTR_GET) +static int +zpl_xattr_acl_get_access(const struct xattr_handler *handler, + struct dentry *dentry, const char *name, void *buffer, size_t size) +{ + int type = handler->flags; + ASSERT3S(type, ==, ACL_TYPE_ACCESS); + return (zpl_xattr_acl_get(dentry->d_inode, name, buffer, size, type)); +} + +static int +zpl_xattr_acl_get_default(const struct xattr_handler *handler, + struct dentry *dentry, const char *name, void *buffer, size_t size) +{ + int type = handler->flags; + ASSERT3S(type, ==, ACL_TYPE_DEFAULT); + return (zpl_xattr_acl_get(dentry->d_inode, name, buffer, size, type)); +} + #else static int @@ -1156,6 +1198,29 @@ zpl_xattr_acl_set_default(struct dentry *dentry, const char *name, name, value, size, flags, type); } +#elif defined(HAVE_HANDLER_XATTR_SET) +static int +zpl_xattr_acl_set_access(const struct xattr_handler *handler, + struct dentry *dentry, const char *name, const void *value, size_t size, + int flags) +{ + int type = handler->flags; + ASSERT3S(type, ==, ACL_TYPE_ACCESS); + return (zpl_xattr_acl_set(dentry->d_inode, + name, value, size, flags, type)); +} + +static int +zpl_xattr_acl_set_default(const struct xattr_handler *handler, + struct dentry *dentry, const char *name, const void *value, size_t size, + int flags) +{ + int type = handler->flags; + ASSERT3S(type, ==, ACL_TYPE_DEFAULT); + return zpl_xattr_acl_set(dentry->d_inode, + name, value, size, flags, type); +} + #else static int @@ -1181,7 +1246,7 @@ struct xattr_handler zpl_xattr_acl_access_handler = .list = zpl_xattr_acl_list_access, .get = zpl_xattr_acl_get_access, .set = zpl_xattr_acl_set_access, -#ifdef HAVE_DENTRY_XATTR_LIST +#if defined(HAVE_DENTRY_XATTR_LIST) || defined(HAVE_HANDLER_XATTR_LIST) .flags = ACL_TYPE_ACCESS, #endif /* HAVE_DENTRY_XATTR_LIST */ }; @@ -1192,7 +1257,7 @@ struct xattr_handler zpl_xattr_acl_default_handler = .list = zpl_xattr_acl_list_default, .get = zpl_xattr_acl_get_default, .set = zpl_xattr_acl_set_default, -#ifdef HAVE_DENTRY_XATTR_LIST +#if defined(HAVE_DENTRY_XATTR_LIST) || defined(HAVE_HANDLER_XATTR_LIST) .flags = ACL_TYPE_DEFAULT, #endif /* HAVE_DENTRY_XATTR_LIST */ }; |