Liu Hui
2008-Jan-27 03:31 UTC
[Btrfs-devel][PATCH] The first patch of acl supporting for btrfs(patch for btrfs-progs-unstable)
Hi: This is the first patch of acl supporting. Because we want to btrfs work with posix acl by default, so we need disable root dir's acl option when mkfs. This patch modify btrfs_make_root_dir function to mark BTRFS_INODE_NO_DEFAULT_ACL and BTRFS_INODE_NO_ACCESS_ACL in root dir inode's flag when make_btrfs. -- diff -r 8fa86919eee3 ctree.h --- a/ctree.h Tue Jan 22 11:34:13 2008 -0500 +++ b/ctree.h Sun Jan 27 19:08:07 2008 +0800 @@ -58,6 +58,12 @@ struct btrfs_trans_handle; #define BTRFS_FT_SYMLINK 7 #define BTRFS_FT_XATTR 8 #define BTRFS_FT_MAX 9 + +#define BTRFS_INODE_NODATASUM (1 << 0) +#define BTRFS_INODE_NODATACOW (1 << 1) +#define BTRFS_INODE_READONLY (1 << 2) +#define BTRFS_INODE_NO_ACCESS_ACL (1 << 3) +#define BTRFS_INODE_NO_DEFAULT_ACL (1 << 4) /* * the key defines the order in the tree, and so it also defines (optimal) diff -r 8fa86919eee3 utils.c --- a/utils.c Tue Jan 22 11:34:13 2008 -0500 +++ b/utils.c Sun Jan 27 19:08:07 2008 +0800 @@ -213,6 +213,8 @@ int btrfs_make_root_dir(struct btrfs_tra btrfs_set_stack_inode_nlink(&inode_item, 1); btrfs_set_stack_inode_nblocks(&inode_item, 1); btrfs_set_stack_inode_mode(&inode_item, S_IFDIR | 0555); + btrfs_set_stack_inode_flags(&inode_item, BTRFS_INODE_NO_DEFAULT_ACL | + BTRFS_INODE_NO_ACCESS_ACL); if (root->fs_info->tree_root == root) btrfs_set_super_root_dir(&root->fs_info->super_copy, objectid); -- Thanks & Best Regards Liu Hui