1 // SPDX-License-Identifier: GPL-2.0
3 * linux/fs/hfsplus/xattr_trusted.c
5 * Vyacheslav Dubeyko <slava@dubeyko.com>
7 * Handler for trusted extended attributes.
10 #include <linux/nls.h>
12 #include "hfsplus_fs.h"
15 static int hfsplus_trusted_getxattr(const struct xattr_handler *handler,
16 struct dentry *unused, struct inode *inode,
17 const char *name, void *buffer, size_t size)
19 return hfsplus_getxattr(inode, name, buffer, size,
21 XATTR_TRUSTED_PREFIX_LEN);
24 static int hfsplus_trusted_setxattr(const struct xattr_handler *handler,
25 struct mnt_idmap *idmap,
26 struct dentry *unused, struct inode *inode,
27 const char *name, const void *buffer,
28 size_t size, int flags)
30 return hfsplus_setxattr(inode, name, buffer, size, flags,
31 XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN);
34 const struct xattr_handler hfsplus_xattr_trusted_handler = {
35 .prefix = XATTR_TRUSTED_PREFIX,
36 .get = hfsplus_trusted_getxattr,
37 .set = hfsplus_trusted_setxattr,