From fac618e0eb4d0e66b5a328f706f2a858de34b603 Mon Sep 17 00:00:00 2001 From: Su Yue Date: Wed, 18 Dec 2019 13:18:49 +0800 Subject: [PATCH] btrfs-progs: cleanups after block group cache refactoring btrfs_fs_info::block_group_cache and the bit BLOCK_GROUP_DIRY are not used anymore, so is the block_group_state_bits(). Remove them. Reviewed-by: Qu Wenruo Signed-off-by: Su Yue Signed-off-by: David Sterba --- ctree.h | 1 - disk-io.c | 2 -- extent-tree.c | 12 ------------ extent_io.h | 2 -- 4 files changed, 17 deletions(-) diff --git a/ctree.h b/ctree.h index c9e89f34..1c4848ac 100644 --- a/ctree.h +++ b/ctree.h @@ -1150,7 +1150,6 @@ struct btrfs_fs_info { struct extent_io_tree extent_cache; struct extent_io_tree free_space_cache; - struct extent_io_tree block_group_cache; struct extent_io_tree pinned_extents; struct extent_io_tree extent_ins; struct extent_io_tree *excluded_extents; diff --git a/disk-io.c b/disk-io.c index 7c472483..e8a2e4af 100644 --- a/disk-io.c +++ b/disk-io.c @@ -794,7 +794,6 @@ struct btrfs_fs_info *btrfs_new_fs_info(int writable, u64 sb_bytenr) extent_io_tree_init(&fs_info->extent_cache); extent_io_tree_init(&fs_info->free_space_cache); - extent_io_tree_init(&fs_info->block_group_cache); extent_io_tree_init(&fs_info->pinned_extents); extent_io_tree_init(&fs_info->extent_ins); @@ -1069,7 +1068,6 @@ void btrfs_cleanup_all_caches(struct btrfs_fs_info *fs_info) free_mapping_cache_tree(&fs_info->mapping_tree.cache_tree); extent_io_tree_cleanup(&fs_info->extent_cache); extent_io_tree_cleanup(&fs_info->free_space_cache); - extent_io_tree_cleanup(&fs_info->block_group_cache); extent_io_tree_cleanup(&fs_info->pinned_extents); extent_io_tree_cleanup(&fs_info->extent_ins); } diff --git a/extent-tree.c b/extent-tree.c index e02d9191..fb28e49f 100644 --- a/extent-tree.c +++ b/extent-tree.c @@ -329,18 +329,6 @@ wrapped: goto again; } -static int block_group_state_bits(u64 flags) -{ - int bits = 0; - if (flags & BTRFS_BLOCK_GROUP_DATA) - bits |= BLOCK_GROUP_DATA; - if (flags & BTRFS_BLOCK_GROUP_METADATA) - bits |= BLOCK_GROUP_METADATA; - if (flags & BTRFS_BLOCK_GROUP_SYSTEM) - bits |= BLOCK_GROUP_SYSTEM; - return bits; -} - static struct btrfs_block_group_cache * btrfs_find_block_group(struct btrfs_root *root, struct btrfs_block_group_cache *hint, u64 search_start, int data, int owner) diff --git a/extent_io.h b/extent_io.h index c6b8acf9..8b65e2d2 100644 --- a/extent_io.h +++ b/extent_io.h @@ -47,8 +47,6 @@ #define BLOCK_GROUP_METADATA (1U << 2) #define BLOCK_GROUP_SYSTEM (1U << 4) -#define BLOCK_GROUP_DIRTY (1U) - /* * The extent buffer bitmap operations are done with byte granularity instead of * word granularity for two reasons: