xattr_trusted.c 981 B

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