blob: fae6c0ea00305f0e21a84f2489522187f279d550 [file] [log] [blame]
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -08001/*
2 * linux/fs/hfsplus/xattr_user.c
3 *
4 * Vyacheslav Dubeyko <slava@dubeyko.com>
5 *
6 * Handler for user 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_user_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{
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_USER_PREFIX, XATTR_USER_PREFIX_LEN);
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080021}
22
Andreas Gruenbacherd9a82a02015-10-04 19:18:51 +020023static int hfsplus_user_setxattr(const struct xattr_handler *handler,
Al Viro59301222016-05-27 10:19:30 -040024 struct dentry *unused, struct inode *inode,
25 const char *name, const void *buffer,
26 size_t size, int flags)
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080027{
Al Viro59301222016-05-27 10:19:30 -040028 return hfsplus_setxattr(inode, name, buffer, size, flags,
Fabian Frederick5e614732015-04-16 12:47:01 -070029 XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080030}
31
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080032const struct xattr_handler hfsplus_xattr_user_handler = {
33 .prefix = XATTR_USER_PREFIX,
Vyacheslav Dubeyko127e5f52013-02-27 17:03:03 -080034 .get = hfsplus_user_getxattr,
35 .set = hfsplus_user_setxattr,
36};