blob: 889ba89d3f9f5f93b357413a35189eb56abcb513 [file] [log] [blame]
Josef Bacik5103e942007-11-16 11:45:54 -05001/*
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
19#include <linux/fs.h>
20#include <linux/string.h>
21#include <linux/xattr.h>
22#include <linux/posix_acl_xattr.h>
23#include "ctree.h"
24#include "xattr.h"
25
Josef Bacik1caf9342007-11-19 10:18:17 -050026/*
27 * FIXME: At this point this is all place holder stuff, we just return
28 * -EOPNOTSUPP so cp won't complain when it tries to copy over a file with an
29 * acl on it.
30 */
31
Josef Bacik5103e942007-11-16 11:45:54 -050032static int btrfs_xattr_acl_access_get(struct inode *inode, const char *name,
33 void *value, size_t size)
34{
Josef Bacik1caf9342007-11-19 10:18:17 -050035 /*
Josef Bacik5103e942007-11-16 11:45:54 -050036 return btrfs_xattr_get(inode, BTRFS_XATTR_INDEX_POSIX_ACL_ACCESS, name,
37 value, size);
Josef Bacik1caf9342007-11-19 10:18:17 -050038 */
39 return -EOPNOTSUPP;
Josef Bacik5103e942007-11-16 11:45:54 -050040}
41
42static int btrfs_xattr_acl_access_set(struct inode *inode, const char *name,
43 const void *value, size_t size, int flags)
44{
Josef Bacik1caf9342007-11-19 10:18:17 -050045 /*
Josef Bacik5103e942007-11-16 11:45:54 -050046 return btrfs_xattr_set(inode, BTRFS_XATTR_INDEX_POSIX_ACL_ACCESS, name,
47 value, size, flags);
Josef Bacik1caf9342007-11-19 10:18:17 -050048 */
49 return -EOPNOTSUPP;
Josef Bacik5103e942007-11-16 11:45:54 -050050}
51
52static int btrfs_xattr_acl_default_get(struct inode *inode, const char *name,
53 void *value, size_t size)
54{
Josef Bacik1caf9342007-11-19 10:18:17 -050055 /*
Josef Bacik5103e942007-11-16 11:45:54 -050056 return btrfs_xattr_get(inode, BTRFS_XATTR_INDEX_POSIX_ACL_DEFAULT,
57 name, value, size);
Josef Bacik1caf9342007-11-19 10:18:17 -050058 */
59 return -EOPNOTSUPP;
Josef Bacik5103e942007-11-16 11:45:54 -050060}
61
62static int btrfs_xattr_acl_default_set(struct inode *inode, const char *name,
63 const void *value, size_t size, int flags)
64{
Josef Bacik1caf9342007-11-19 10:18:17 -050065 /*
Josef Bacik5103e942007-11-16 11:45:54 -050066 return btrfs_xattr_set(inode, BTRFS_XATTR_INDEX_POSIX_ACL_DEFAULT,
67 name, value, size, flags);
Josef Bacik1caf9342007-11-19 10:18:17 -050068 */
69 return -EOPNOTSUPP;
Josef Bacik5103e942007-11-16 11:45:54 -050070}
71
72struct xattr_handler btrfs_xattr_acl_default_handler = {
73 .prefix = POSIX_ACL_XATTR_DEFAULT,
74 .list = btrfs_xattr_generic_list,
75 .get = btrfs_xattr_acl_default_get,
76 .set = btrfs_xattr_acl_default_set,
77};
78
79struct xattr_handler btrfs_xattr_acl_access_handler = {
80 .prefix = POSIX_ACL_XATTR_ACCESS,
81 .list = btrfs_xattr_generic_list,
82 .get = btrfs_xattr_acl_access_get,
83 .set = btrfs_xattr_acl_access_set,
84};