xattr_user.c 963 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. {
  16. return hfsplus_getxattr(inode, name, buffer, size,
  17. XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
  18. }
  19. static int hfsplus_user_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_USER_PREFIX, XATTR_USER_PREFIX_LEN);
  26. }
  27. const struct xattr_handler hfsplus_xattr_user_handler = {
  28. .prefix = XATTR_USER_PREFIX,
  29. .get = hfsplus_user_getxattr,
  30. .set = hfsplus_user_setxattr,
  31. };