blob: fbad91e1dada2248c53d39dc104407f577a0a79c [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -08002/*
3 * linux/fs/hfsplus/xattr_trusted.c
4 *
5 * Vyacheslav Dubeyko <slava@dubeyko.com>
6 *
7 * Handler for trusted extended attributes.
8 */
9
Hin-Tak Leungbf29e882014-06-06 14:36:22 -070010#include <linux/nls.h>
11
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080012#include "hfsplus_fs.h"
13#include "xattr.h"
14
Andreas Gruenbacherd9a82a02015-10-04 19:18:51 +020015static int hfsplus_trusted_getxattr(const struct xattr_handler *handler,
Al Virob2968212016-04-10 20:48:24 -040016 struct dentry *unused, struct inode *inode,
17 const char *name, void *buffer, size_t size)
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080018{
Al Virob2968212016-04-10 20:48:24 -040019 return hfsplus_getxattr(inode, name, buffer, size,
Fabian Fredericka3cef4c2015-04-16 12:46:58 -070020 XATTR_TRUSTED_PREFIX,
21 XATTR_TRUSTED_PREFIX_LEN);
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080022}
23
Andreas Gruenbacherd9a82a02015-10-04 19:18:51 +020024static int hfsplus_trusted_setxattr(const struct xattr_handler *handler,
Al Viro59301222016-05-27 10:19:30 -040025 struct dentry *unused, struct inode *inode,
26 const char *name, const void *buffer,
27 size_t size, int flags)
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080028{
Al Viro59301222016-05-27 10:19:30 -040029 return hfsplus_setxattr(inode, name, buffer, size, flags,
Fabian Frederick5e614732015-04-16 12:47:01 -070030 XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN);
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080031}
32
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080033const struct xattr_handler hfsplus_xattr_trusted_handler = {
34 .prefix = XATTR_TRUSTED_PREFIX,
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080035 .get = hfsplus_trusted_getxattr,
36 .set = hfsplus_trusted_setxattr,
37};