Btrfs: Add ACL support

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Josef Bacik
2008-07-24 12:16:36 -04:00
committed by Chris Mason
parent 6099afe88f
commit 33268eaf0b
6 changed files with 335 additions and 48 deletions

View File

@@ -26,25 +26,27 @@
#include "transaction.h"
#include "xattr.h"
#include "disk-io.h"
static struct xattr_handler *btrfs_xattr_handler_map[] = {
[BTRFS_XATTR_INDEX_USER] = &btrfs_xattr_user_handler,
#ifdef CONFIG_FS_POSIX_ACL
// [BTRFS_XATTR_INDEX_POSIX_ACL_ACCESS] = &btrfs_xattr_acl_access_handler,
// [BTRFS_XATTR_INDEX_POSIX_ACL_DEFAULT] = &btrfs_xattr_acl_default_handler,
[BTRFS_XATTR_INDEX_POSIX_ACL_ACCESS] = &btrfs_xattr_acl_access_handler,
[BTRFS_XATTR_INDEX_POSIX_ACL_DEFAULT] = &btrfs_xattr_acl_default_handler,
#endif
[BTRFS_XATTR_INDEX_TRUSTED] = &btrfs_xattr_trusted_handler,
[BTRFS_XATTR_INDEX_SECURITY] = &btrfs_xattr_security_handler,
// [BTRFS_XATTR_INDEX_SYSTEM] = &btrfs_xattr_system_handler,
[BTRFS_XATTR_INDEX_SYSTEM] = &btrfs_xattr_system_handler,
};
struct xattr_handler *btrfs_xattr_handlers[] = {
&btrfs_xattr_user_handler,
#ifdef CONFIG_FS_POSIX_ACL
// &btrfs_xattr_acl_access_handler,
// &btrfs_xattr_acl_default_handler,
&btrfs_xattr_acl_access_handler,
&btrfs_xattr_acl_default_handler,
#endif
&btrfs_xattr_trusted_handler,
&btrfs_xattr_security_handler,
// &btrfs_xattr_system_handler,
&btrfs_xattr_system_handler,
NULL,
};
@@ -237,10 +239,14 @@ int btrfs_xattr_set(struct inode *inode, int name_index,
mod = 1;
goto out;
}
} else if (flags & XATTR_REPLACE) {
/* we couldn't find the attr to replace, so error out */
ret = -ENODATA;
goto out;
} else {
btrfs_release_path(root, path);
if (flags & XATTR_REPLACE) {
/* we couldn't find the attr to replace */
ret = -ENODATA;
goto out;
}
}
/* ok we have to create a completely new xattr */