xattr.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* -*- mode: c; c-basic-offset: 8; -*-
  2. * vim: noexpandtab sw=8 ts=8 sts=0:
  3. *
  4. * xattr.h
  5. *
  6. * Copyright (C) 2004, 2008 Oracle. All rights reserved.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public
  10. * License version 2 as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. */
  17. #ifndef OCFS2_XATTR_H
  18. #define OCFS2_XATTR_H
  19. #include <linux/init.h>
  20. #include <linux/xattr.h>
  21. enum ocfs2_xattr_type {
  22. OCFS2_XATTR_INDEX_USER = 1,
  23. OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS,
  24. OCFS2_XATTR_INDEX_POSIX_ACL_DEFAULT,
  25. OCFS2_XATTR_INDEX_TRUSTED,
  26. OCFS2_XATTR_INDEX_SECURITY,
  27. OCFS2_XATTR_MAX
  28. };
  29. struct ocfs2_security_xattr_info {
  30. int enable;
  31. char *name;
  32. void *value;
  33. size_t value_len;
  34. };
  35. extern struct xattr_handler ocfs2_xattr_user_handler;
  36. extern struct xattr_handler ocfs2_xattr_trusted_handler;
  37. extern struct xattr_handler ocfs2_xattr_security_handler;
  38. #ifdef CONFIG_OCFS2_FS_POSIX_ACL
  39. extern struct xattr_handler ocfs2_xattr_acl_access_handler;
  40. extern struct xattr_handler ocfs2_xattr_acl_default_handler;
  41. #endif
  42. extern struct xattr_handler *ocfs2_xattr_handlers[];
  43. ssize_t ocfs2_listxattr(struct dentry *, char *, size_t);
  44. int ocfs2_xattr_get_nolock(struct inode *, struct buffer_head *, int,
  45. const char *, void *, size_t);
  46. int ocfs2_xattr_set(struct inode *, int, const char *, const void *,
  47. size_t, int);
  48. int ocfs2_xattr_set_handle(handle_t *, struct inode *, struct buffer_head *,
  49. int, const char *, const void *, size_t, int,
  50. struct ocfs2_alloc_context *,
  51. struct ocfs2_alloc_context *);
  52. int ocfs2_xattr_remove(struct inode *, struct buffer_head *);
  53. int ocfs2_init_security_get(struct inode *, struct inode *,
  54. struct ocfs2_security_xattr_info *);
  55. int ocfs2_init_security_set(handle_t *, struct inode *,
  56. struct buffer_head *,
  57. struct ocfs2_security_xattr_info *,
  58. struct ocfs2_alloc_context *,
  59. struct ocfs2_alloc_context *);
  60. int ocfs2_calc_security_init(struct inode *,
  61. struct ocfs2_security_xattr_info *,
  62. int *, int *, struct ocfs2_alloc_context **);
  63. int ocfs2_calc_xattr_init(struct inode *, struct buffer_head *,
  64. int, struct ocfs2_security_xattr_info *,
  65. int *, int *, struct ocfs2_alloc_context **);
  66. #endif /* OCFS2_XATTR_H */