blob: eae2947060aa1892f425dd4eb2377d035a9e06b2 [file] [log] [blame]
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -08001/*
2 * linux/fs/hfsplus/xattr_trusted.c
3 *
4 * Vyacheslav Dubeyko <slava@dubeyko.com>
5 *
6 * Handler for trusted extended attributes.
7 */
8
Hin-Tak Leungbf29e882014-06-06 14:36:22 -07009#include <linux/nls.h>
10
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080011#include "hfsplus_fs.h"
12#include "xattr.h"
13
Andreas Gruenbacherd9a82a02015-10-04 19:18:51 +020014static int hfsplus_trusted_getxattr(const struct xattr_handler *handler,
Al Virob2968212016-04-10 20:48:24 -040015 struct dentry *unused, struct inode *inode,
16 const char *name, void *buffer, size_t size)
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080017{
Al Virob2968212016-04-10 20:48:24 -040018 return hfsplus_getxattr(inode, name, buffer, size,
Fabian Fredericka3cef4c2015-04-16 12:46:58 -070019 XATTR_TRUSTED_PREFIX,
20 XATTR_TRUSTED_PREFIX_LEN);
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080021}
22
Andreas Gruenbacherd9a82a02015-10-04 19:18:51 +020023static int hfsplus_trusted_setxattr(const struct xattr_handler *handler,
24 struct dentry *dentry, const char *name,
25 const void *buffer, size_t size, int flags)
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080026{
Fabian Frederick5e614732015-04-16 12:47:01 -070027 return hfsplus_setxattr(dentry, name, buffer, size, flags,
28 XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN);
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080029}
30
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080031const struct xattr_handler hfsplus_xattr_trusted_handler = {
32 .prefix = XATTR_TRUSTED_PREFIX,
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080033 .get = hfsplus_trusted_getxattr,
34 .set = hfsplus_trusted_setxattr,
35};