xattr_user.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * linux/fs/hfsplus/xattr_user.c
  3. *
  4. * Vyacheslav Dubeyko <slava@dubeyko.com>
  5. *
  6. * Handler for user extended attributes.
  7. */
  8. #include <linux/nls.h>
  9. #include "hfsplus_fs.h"
  10. #include "xattr.h"
  11. static int hfsplus_user_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_USER_PREFIX, XATTR_USER_PREFIX_LEN);
  16. }
  17. static int hfsplus_user_setxattr(struct dentry *dentry, const char *name,
  18. const void *buffer, size_t size, int flags, int type)
  19. {
  20. return hfsplus_setxattr(dentry, name, buffer, size, flags,
  21. XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
  22. }
  23. static size_t hfsplus_user_listxattr(struct dentry *dentry, char *list,
  24. size_t list_size, const char *name, size_t name_len, int type)
  25. {
  26. /*
  27. * This method is not used.
  28. * It is used hfsplus_listxattr() instead of generic_listxattr().
  29. */
  30. return -EOPNOTSUPP;
  31. }
  32. const struct xattr_handler hfsplus_xattr_user_handler = {
  33. .prefix = XATTR_USER_PREFIX,
  34. .list = hfsplus_user_listxattr,
  35. .get = hfsplus_user_getxattr,
  36. .set = hfsplus_user_setxattr,
  37. };