2 * Copyright (C) 2007 Red Hat. All rights reserved.
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.
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.
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.
20 #include <linux/string.h>
21 #include <linux/xattr.h>
22 #include <linux/posix_acl_xattr.h>
26 static int btrfs_xattr_acl_access_get(struct inode *inode, const char *name,
27 void *value, size_t size)
29 return btrfs_xattr_get(inode, BTRFS_XATTR_INDEX_POSIX_ACL_ACCESS, name,
33 static int btrfs_xattr_acl_access_set(struct inode *inode, const char *name,
34 const void *value, size_t size, int flags)
36 return btrfs_xattr_set(inode, BTRFS_XATTR_INDEX_POSIX_ACL_ACCESS, name,
40 static int btrfs_xattr_acl_default_get(struct inode *inode, const char *name,
41 void *value, size_t size)
43 return btrfs_xattr_get(inode, BTRFS_XATTR_INDEX_POSIX_ACL_DEFAULT,
47 static int btrfs_xattr_acl_default_set(struct inode *inode, const char *name,
48 const void *value, size_t size, int flags)
50 return btrfs_xattr_set(inode, BTRFS_XATTR_INDEX_POSIX_ACL_DEFAULT,
51 name, value, size, flags);
54 struct xattr_handler btrfs_xattr_acl_default_handler = {
55 .prefix = POSIX_ACL_XATTR_DEFAULT,
56 .list = btrfs_xattr_generic_list,
57 .get = btrfs_xattr_acl_default_get,
58 .set = btrfs_xattr_acl_default_set,
61 struct xattr_handler btrfs_xattr_acl_access_handler = {
62 .prefix = POSIX_ACL_XATTR_ACCESS,
63 .list = btrfs_xattr_generic_list,
64 .get = btrfs_xattr_acl_access_get,
65 .set = btrfs_xattr_acl_access_set,