xattr_user.c 979 B

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