xattr.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (C) 2007 Red Hat. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public
  6. * License v2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public
  14. * License along with this program; if not, write to the
  15. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  16. * Boston, MA 021110-1307, USA.
  17. */
  18. #ifndef __XATTR__
  19. #define __XATTR__
  20. #include <linux/xattr.h>
  21. #include "ctree.h"
  22. /* Name indexes */
  23. enum {
  24. BTRFS_XATTR_INDEX_USER,
  25. BTRFS_XATTR_INDEX_POSIX_ACL_ACCESS,
  26. BTRFS_XATTR_INDEX_POSIX_ACL_DEFAULT,
  27. BTRFS_XATTR_INDEX_TRUSTED,
  28. BTRFS_XATTR_INDEX_SECURITY,
  29. BTRFS_XATTR_INDEX_SYSTEM,
  30. BTRFS_XATTR_INDEX_END,
  31. };
  32. extern struct xattr_handler btrfs_xattr_user_handler;
  33. extern struct xattr_handler btrfs_xattr_trusted_handler;
  34. extern struct xattr_handler btrfs_xattr_acl_access_handler;
  35. extern struct xattr_handler btrfs_xattr_acl_default_handler;
  36. extern struct xattr_handler btrfs_xattr_security_handler;
  37. extern struct xattr_handler btrfs_xattr_system_handler;
  38. extern struct xattr_handler *btrfs_xattr_handlers[];
  39. ssize_t btrfs_xattr_get(struct inode *inode, int name_index, const char *name,
  40. void *buffer, size_t size);
  41. int btrfs_xattr_set(struct inode *inode, int name_index, const char *name,
  42. const void *value, size_t size, int flags);
  43. /*
  44. * the only reason this is public is for acl.c. There may be a point where
  45. * acl.c doesn't need it, and if thats the case we need to remove it and make
  46. * it static in xattr.c
  47. */
  48. size_t btrfs_xattr_generic_list(struct inode *inode, char *list,
  49. size_t list_size, const char *name,
  50. size_t name_len);
  51. #endif /* __XATTR__ */