aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/xattr.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@redhat.com>2008-07-24 12:16:36 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:05 -0400
commit33268eaf0b3db5e2bd12c0ada81a8e8f87a46d68 (patch)
tree93b6d00a73402b59c2ea7ae7434138feecefc085 /fs/btrfs/xattr.c
parent6099afe88fe64b2f47c43a8a71c13be3a416bbf7 (diff)
Btrfs: Add ACL support
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/xattr.c')
-rw-r--r--fs/btrfs/xattr.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c
index 6730b5958844..121c9550314f 100644
--- a/fs/btrfs/xattr.c
+++ b/fs/btrfs/xattr.c
@@ -26,25 +26,27 @@
26#include "transaction.h" 26#include "transaction.h"
27#include "xattr.h" 27#include "xattr.h"
28#include "disk-io.h" 28#include "disk-io.h"
29
29static struct xattr_handler *btrfs_xattr_handler_map[] = { 30static struct xattr_handler *btrfs_xattr_handler_map[] = {
30 [BTRFS_XATTR_INDEX_USER] = &btrfs_xattr_user_handler, 31 [BTRFS_XATTR_INDEX_USER] = &btrfs_xattr_user_handler,
31#ifdef CONFIG_FS_POSIX_ACL 32#ifdef CONFIG_FS_POSIX_ACL
32// [BTRFS_XATTR_INDEX_POSIX_ACL_ACCESS] = &btrfs_xattr_acl_access_handler, 33 [BTRFS_XATTR_INDEX_POSIX_ACL_ACCESS] = &btrfs_xattr_acl_access_handler,
33// [BTRFS_XATTR_INDEX_POSIX_ACL_DEFAULT] = &btrfs_xattr_acl_default_handler, 34 [BTRFS_XATTR_INDEX_POSIX_ACL_DEFAULT] = &btrfs_xattr_acl_default_handler,
34#endif 35#endif
35 [BTRFS_XATTR_INDEX_TRUSTED] = &btrfs_xattr_trusted_handler, 36 [BTRFS_XATTR_INDEX_TRUSTED] = &btrfs_xattr_trusted_handler,
36 [BTRFS_XATTR_INDEX_SECURITY] = &btrfs_xattr_security_handler, 37 [BTRFS_XATTR_INDEX_SECURITY] = &btrfs_xattr_security_handler,
37// [BTRFS_XATTR_INDEX_SYSTEM] = &btrfs_xattr_system_handler, 38 [BTRFS_XATTR_INDEX_SYSTEM] = &btrfs_xattr_system_handler,
38}; 39};
40
39struct xattr_handler *btrfs_xattr_handlers[] = { 41struct xattr_handler *btrfs_xattr_handlers[] = {
40 &btrfs_xattr_user_handler, 42 &btrfs_xattr_user_handler,
41#ifdef CONFIG_FS_POSIX_ACL 43#ifdef CONFIG_FS_POSIX_ACL
42// &btrfs_xattr_acl_access_handler, 44 &btrfs_xattr_acl_access_handler,
43// &btrfs_xattr_acl_default_handler, 45 &btrfs_xattr_acl_default_handler,
44#endif 46#endif
45 &btrfs_xattr_trusted_handler, 47 &btrfs_xattr_trusted_handler,
46 &btrfs_xattr_security_handler, 48 &btrfs_xattr_security_handler,
47// &btrfs_xattr_system_handler, 49 &btrfs_xattr_system_handler,
48 NULL, 50 NULL,
49}; 51};
50 52
@@ -237,10 +239,14 @@ int btrfs_xattr_set(struct inode *inode, int name_index,
237 mod = 1; 239 mod = 1;
238 goto out; 240 goto out;
239 } 241 }
240 } else if (flags & XATTR_REPLACE) { 242 } else {
241 /* we couldn't find the attr to replace, so error out */ 243 btrfs_release_path(root, path);
242 ret = -ENODATA; 244
243 goto out; 245 if (flags & XATTR_REPLACE) {
246 /* we couldn't find the attr to replace */
247 ret = -ENODATA;
248 goto out;
249 }
244 } 250 }
245 251
246 /* ok we have to create a completely new xattr */ 252 /* ok we have to create a completely new xattr */