xattr_trusted.c 1.0 KB

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