acl.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. #include <linux/fs.h>
  19. #include <linux/string.h>
  20. #include <linux/xattr.h>
  21. #include <linux/posix_acl_xattr.h>
  22. #include "ctree.h"
  23. #include "xattr.h"
  24. /*
  25. * FIXME: At this point this is all place holder stuff, we just return
  26. * -EOPNOTSUPP so cp won't complain when it tries to copy over a file with an
  27. * acl on it.
  28. */
  29. static int btrfs_xattr_acl_access_get(struct inode *inode, const char *name,
  30. void *value, size_t size)
  31. {
  32. /*
  33. return btrfs_xattr_get(inode, BTRFS_XATTR_INDEX_POSIX_ACL_ACCESS, name,
  34. value, size);
  35. */
  36. return -EOPNOTSUPP;
  37. }
  38. static int btrfs_xattr_acl_access_set(struct inode *inode, const char *name,
  39. const void *value, size_t size, int flags)
  40. {
  41. /*
  42. return btrfs_xattr_set(inode, BTRFS_XATTR_INDEX_POSIX_ACL_ACCESS, name,
  43. value, size, flags);
  44. */
  45. return -EOPNOTSUPP;
  46. }
  47. static int btrfs_xattr_acl_default_get(struct inode *inode, const char *name,
  48. void *value, size_t size)
  49. {
  50. /*
  51. return btrfs_xattr_get(inode, BTRFS_XATTR_INDEX_POSIX_ACL_DEFAULT,
  52. name, value, size);
  53. */
  54. return -EOPNOTSUPP;
  55. }
  56. static int btrfs_xattr_acl_default_set(struct inode *inode, const char *name,
  57. const void *value, size_t size, int flags)
  58. {
  59. /*
  60. return btrfs_xattr_set(inode, BTRFS_XATTR_INDEX_POSIX_ACL_DEFAULT,
  61. name, value, size, flags);
  62. */
  63. return -EOPNOTSUPP;
  64. }
  65. struct xattr_handler btrfs_xattr_acl_default_handler = {
  66. .prefix = POSIX_ACL_XATTR_DEFAULT,
  67. .list = btrfs_xattr_generic_list,
  68. .get = btrfs_xattr_acl_default_get,
  69. .set = btrfs_xattr_acl_default_set,
  70. };
  71. struct xattr_handler btrfs_xattr_acl_access_handler = {
  72. .prefix = POSIX_ACL_XATTR_ACCESS,
  73. .list = btrfs_xattr_generic_list,
  74. .get = btrfs_xattr_acl_access_get,
  75. .set = btrfs_xattr_acl_access_set,
  76. };