Vyacheslav Dubeyko | 127e5f5 | 2013-02-27 17:03:03 -0800 | [diff] [blame] | 1 | /* |
| 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 Leung | bf29e88 | 2014-06-06 14:36:22 -0700 | [diff] [blame] | 9 | #include <linux/nls.h> |
| 10 | |
Vyacheslav Dubeyko | 127e5f5 | 2013-02-27 17:03:03 -0800 | [diff] [blame] | 11 | #include "hfsplus_fs.h" |
| 12 | #include "xattr.h" |
| 13 | |
| 14 | static int hfsplus_user_getxattr(struct dentry *dentry, const char *name, |
| 15 | void *buffer, size_t size, int type) |
| 16 | { |
Vyacheslav Dubeyko | 127e5f5 | 2013-02-27 17:03:03 -0800 | [diff] [blame] | 17 | |
Fabian Frederick | a3cef4c | 2015-04-16 12:46:58 -0700 | [diff] [blame] | 18 | return hfsplus_getxattr(dentry, name, buffer, size, |
| 19 | XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN); |
Vyacheslav Dubeyko | 127e5f5 | 2013-02-27 17:03:03 -0800 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | static int hfsplus_user_setxattr(struct dentry *dentry, const char *name, |
| 23 | const void *buffer, size_t size, int flags, int type) |
| 24 | { |
Fabian Frederick | 5e61473 | 2015-04-16 12:47:01 -0700 | [diff] [blame] | 25 | return hfsplus_setxattr(dentry, name, buffer, size, flags, |
| 26 | XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN); |
Vyacheslav Dubeyko | 127e5f5 | 2013-02-27 17:03:03 -0800 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | static size_t hfsplus_user_listxattr(struct dentry *dentry, char *list, |
| 30 | size_t list_size, const char *name, size_t name_len, int type) |
| 31 | { |
| 32 | /* |
| 33 | * This method is not used. |
| 34 | * It is used hfsplus_listxattr() instead of generic_listxattr(). |
| 35 | */ |
| 36 | return -EOPNOTSUPP; |
| 37 | } |
| 38 | |
| 39 | const struct xattr_handler hfsplus_xattr_user_handler = { |
| 40 | .prefix = XATTR_USER_PREFIX, |
| 41 | .list = hfsplus_user_listxattr, |
| 42 | .get = hfsplus_user_getxattr, |
| 43 | .set = hfsplus_user_setxattr, |
| 44 | }; |