btrfs-progs: block-group: add rb-tree related memebers
To convert from existing extent_cache to plain rb_tree, add btrfs_block_group_cache::cache_node and btrfs_fs_info::block_group_cache_tree. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Su Yue <Damenly_Su@gmx.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
764c8dea72
commit
2eaf862f46
21
ctree.h
21
ctree.h
|
@ -1111,16 +1111,18 @@ struct btrfs_block_group_cache {
|
||||||
int cached;
|
int cached;
|
||||||
int ro;
|
int ro;
|
||||||
/*
|
/*
|
||||||
* If the free space extent count exceeds this number, convert the block
|
* If the free space extent count exceeds this number, convert the block
|
||||||
* group to bitmaps.
|
* group to bitmaps.
|
||||||
*/
|
*/
|
||||||
u32 bitmap_high_thresh;
|
u32 bitmap_high_thresh;
|
||||||
/*
|
/*
|
||||||
* If the free space extent count drops below this number, convert the
|
* If the free space extent count drops below this number, convert the
|
||||||
* block group back to extents.
|
* block group back to extents.
|
||||||
*/
|
*/
|
||||||
u32 bitmap_low_thresh;
|
u32 bitmap_low_thresh;
|
||||||
|
|
||||||
|
/* Block group cache stuff */
|
||||||
|
struct rb_node cache_node;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct btrfs_device;
|
struct btrfs_device;
|
||||||
|
@ -1150,6 +1152,7 @@ struct btrfs_fs_info {
|
||||||
struct extent_io_tree extent_ins;
|
struct extent_io_tree extent_ins;
|
||||||
struct extent_io_tree *excluded_extents;
|
struct extent_io_tree *excluded_extents;
|
||||||
|
|
||||||
|
struct rb_root block_group_cache_tree;
|
||||||
/* logical->physical extent mapping */
|
/* logical->physical extent mapping */
|
||||||
struct btrfs_mapping_tree mapping_tree;
|
struct btrfs_mapping_tree mapping_tree;
|
||||||
|
|
||||||
|
|
|
@ -797,6 +797,8 @@ struct btrfs_fs_info *btrfs_new_fs_info(int writable, u64 sb_bytenr)
|
||||||
extent_io_tree_init(&fs_info->block_group_cache);
|
extent_io_tree_init(&fs_info->block_group_cache);
|
||||||
extent_io_tree_init(&fs_info->pinned_extents);
|
extent_io_tree_init(&fs_info->pinned_extents);
|
||||||
extent_io_tree_init(&fs_info->extent_ins);
|
extent_io_tree_init(&fs_info->extent_ins);
|
||||||
|
|
||||||
|
fs_info->block_group_cache_tree = RB_ROOT;
|
||||||
fs_info->excluded_extents = NULL;
|
fs_info->excluded_extents = NULL;
|
||||||
|
|
||||||
fs_info->fs_root_tree = RB_ROOT;
|
fs_info->fs_root_tree = RB_ROOT;
|
||||||
|
|
Loading…
Reference in New Issue