xattr_trusted.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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(struct dentry *dentry, const char *name,
  12. void *buffer, size_t size, int type)
  13. {
  14. return hfsplus_getxattr(dentry, name, buffer, size,
  15. XATTR_TRUSTED_PREFIX,
  16. XATTR_TRUSTED_PREFIX_LEN);
  17. }
  18. static int hfsplus_trusted_setxattr(struct dentry *dentry, const char *name,
  19. const void *buffer, size_t size, int flags, int type)
  20. {
  21. return hfsplus_setxattr(dentry, name, buffer, size, flags,
  22. XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN);
  23. }
  24. static size_t hfsplus_trusted_listxattr(struct dentry *dentry, char *list,
  25. size_t list_size, const char *name, size_t name_len, int type)
  26. {
  27. /*
  28. * This method is not used.
  29. * It is used hfsplus_listxattr() instead of generic_listxattr().
  30. */
  31. return -EOPNOTSUPP;
  32. }
  33. const struct xattr_handler hfsplus_xattr_trusted_handler = {
  34. .prefix = XATTR_TRUSTED_PREFIX,
  35. .list = hfsplus_trusted_listxattr,
  36. .get = hfsplus_trusted_getxattr,
  37. .set = hfsplus_trusted_setxattr,
  38. };