162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * linux/fs/hfsplus/xattr_trusted.c
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Vyacheslav Dubeyko <slava@dubeyko.com>
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Handler for trusted extended attributes.
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#include <linux/nls.h>
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#include "hfsplus_fs.h"
1362306a36Sopenharmony_ci#include "xattr.h"
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_cistatic int hfsplus_trusted_getxattr(const struct xattr_handler *handler,
1662306a36Sopenharmony_ci				    struct dentry *unused, struct inode *inode,
1762306a36Sopenharmony_ci				    const char *name, void *buffer, size_t size)
1862306a36Sopenharmony_ci{
1962306a36Sopenharmony_ci	return hfsplus_getxattr(inode, name, buffer, size,
2062306a36Sopenharmony_ci				XATTR_TRUSTED_PREFIX,
2162306a36Sopenharmony_ci				XATTR_TRUSTED_PREFIX_LEN);
2262306a36Sopenharmony_ci}
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_cistatic int hfsplus_trusted_setxattr(const struct xattr_handler *handler,
2562306a36Sopenharmony_ci				    struct mnt_idmap *idmap,
2662306a36Sopenharmony_ci				    struct dentry *unused, struct inode *inode,
2762306a36Sopenharmony_ci				    const char *name, const void *buffer,
2862306a36Sopenharmony_ci				    size_t size, int flags)
2962306a36Sopenharmony_ci{
3062306a36Sopenharmony_ci	return hfsplus_setxattr(inode, name, buffer, size, flags,
3162306a36Sopenharmony_ci				XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN);
3262306a36Sopenharmony_ci}
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ciconst struct xattr_handler hfsplus_xattr_trusted_handler = {
3562306a36Sopenharmony_ci	.prefix	= XATTR_TRUSTED_PREFIX,
3662306a36Sopenharmony_ci	.get	= hfsplus_trusted_getxattr,
3762306a36Sopenharmony_ci	.set	= hfsplus_trusted_setxattr,
3862306a36Sopenharmony_ci};
39