mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
btrfs: introduce tree-log sub-space_info
Introduce the tree-log sub-space_info, which is sub-space of metadata space_info and dedicated for tree-log node allocation. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
f92ee31e03
commit
9a3023b828
3 changed files with 15 additions and 2 deletions
|
|
@ -299,6 +299,11 @@ static int create_space_info(struct btrfs_fs_info *info, u64 flags)
|
|||
ret = create_space_info_sub_group(space_info, flags,
|
||||
BTRFS_SUB_GROUP_DATA_RELOC,
|
||||
0);
|
||||
else if (flags & BTRFS_BLOCK_GROUP_METADATA)
|
||||
ret = create_space_info_sub_group(space_info, flags,
|
||||
BTRFS_SUB_GROUP_TREELOG,
|
||||
0);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ enum btrfs_flush_state {
|
|||
enum btrfs_space_info_sub_group {
|
||||
BTRFS_SUB_GROUP_PRIMARY,
|
||||
BTRFS_SUB_GROUP_DATA_RELOC,
|
||||
BTRFS_SUB_GROUP_TREELOG,
|
||||
};
|
||||
|
||||
#define BTRFS_SPACE_INFO_SUB_GROUP_MAX 1
|
||||
|
|
|
|||
|
|
@ -1938,8 +1938,15 @@ static const char *alloc_name(struct btrfs_space_info *space_info)
|
|||
case BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_DATA:
|
||||
return "mixed";
|
||||
case BTRFS_BLOCK_GROUP_METADATA:
|
||||
ASSERT(space_info->subgroup_id == BTRFS_SUB_GROUP_PRIMARY);
|
||||
return "metadata";
|
||||
switch (space_info->subgroup_id) {
|
||||
case BTRFS_SUB_GROUP_PRIMARY:
|
||||
return "metadata";
|
||||
case BTRFS_SUB_GROUP_TREELOG:
|
||||
return "metadata-treelog";
|
||||
default:
|
||||
WARN_ON_ONCE(1);
|
||||
return "metadata (unknown sub-group)";
|
||||
}
|
||||
case BTRFS_BLOCK_GROUP_DATA:
|
||||
switch (space_info->subgroup_id) {
|
||||
case BTRFS_SUB_GROUP_PRIMARY:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue