acl.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* -*- mode: c; c-basic-offset: 8; -*-
  2. * vim: noexpandtab sw=8 ts=8 sts=0:
  3. *
  4. * acl.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_ACL_H
  18. #define OCFS2_ACL_H
  19. #include <linux/posix_acl_xattr.h>
  20. struct ocfs2_acl_entry {
  21. __le16 e_tag;
  22. __le16 e_perm;
  23. __le32 e_id;
  24. };
  25. #ifdef CONFIG_OCFS2_FS_POSIX_ACL
  26. extern int ocfs2_check_acl(struct inode *, int);
  27. extern int ocfs2_acl_chmod(struct inode *);
  28. extern int ocfs2_init_acl(handle_t *, struct inode *, struct inode *,
  29. struct buffer_head *, struct buffer_head *,
  30. struct ocfs2_alloc_context *,
  31. struct ocfs2_alloc_context *);
  32. #else /* CONFIG_OCFS2_FS_POSIX_ACL*/
  33. #define ocfs2_check_acl NULL
  34. static inline int ocfs2_acl_chmod(struct inode *inode)
  35. {
  36. return 0;
  37. }
  38. static inline int ocfs2_init_acl(handle_t *handle,
  39. struct inode *inode,
  40. struct inode *dir,
  41. struct buffer_head *di_bh,
  42. struct buffer_head *dir_bh,
  43. struct ocfs2_alloc_context *meta_ac,
  44. struct ocfs2_alloc_context *data_ac)
  45. {
  46. return 0;
  47. }
  48. #endif /* CONFIG_OCFS2_FS_POSIX_ACL*/
  49. #endif /* OCFS2_ACL_H */