| 1 | /* |
| 2 | * linux/fs/hfsplus/xattr_trusted.c |
| 3 | * |
| 4 | * Vyacheslav Dubeyko <slava@dubeyko.com> |
| 5 | * |
| 6 | * Handler for trusted extended attributes. |
| 7 | */ |
| 8 | |
| 9 | #include <linux/nls.h> |
| 10 | |
| 11 | #include "hfsplus_fs.h" |
| 12 | #include "xattr.h" |
| 13 | |
| 14 | static int hfsplus_trusted_getxattr(const struct xattr_handler *handler, |
| 15 | struct dentry *unused, struct inode *inode, |
| 16 | const char *name, void *buffer, size_t size) |
| 17 | { |
| 18 | return hfsplus_getxattr(inode, name, buffer, size, |
| 19 | XATTR_TRUSTED_PREFIX, |
| 20 | XATTR_TRUSTED_PREFIX_LEN); |
| 21 | } |
| 22 | |
| 23 | static int hfsplus_trusted_setxattr(const struct xattr_handler *handler, |
| 24 | struct dentry *unused, struct inode *inode, |
| 25 | const char *name, const void *buffer, |
| 26 | size_t size, int flags) |
| 27 | { |
| 28 | return hfsplus_setxattr(inode, name, buffer, size, flags, |
| 29 | XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN); |
| 30 | } |
| 31 | |
| 32 | const struct xattr_handler hfsplus_xattr_trusted_handler = { |
| 33 | .prefix = XATTR_TRUSTED_PREFIX, |
| 34 | .get = hfsplus_trusted_getxattr, |
| 35 | .set = hfsplus_trusted_setxattr, |
| 36 | }; |