public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: damenly.su@gmail.com
To: linux-btrfs@vger.kernel.org
Cc: Su Yue <Damenly_Su@gmx.com>
Subject: [PATCH 10/10] btrfs-progs: cleanups after block group cache reform
Date: Thu,  5 Dec 2019 12:29:21 +0800	[thread overview]
Message-ID: <20191205042921.25316-11-Damenly_Su@gmx.com> (raw)
In-Reply-To: <20191205042921.25316-1-Damenly_Su@gmx.com>

From: Su Yue <Damenly_Su@gmx.com>

btrfs_fs_info::block_group_cache and the bit BLOCK_GROUP_DIRY are
useless. So is the block_group_state_bits().

Remove them.

Signed-off-by: Su Yue <Damenly_Su@gmx.com>
---
 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 53882d04ac03..6d2fad6406d7 100644
--- a/ctree.h
+++ b/ctree.h
@@ -1146,7 +1146,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 b7ae72a99f59..95958d9706da 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 e227c4db51cf..2815888b6cc5 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -333,18 +333,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 1715acc60708..7f88e3f8a305 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:
-- 
2.21.0 (Apple Git-122)


  parent reply	other threads:[~2019-12-05  4:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05  4:29 [PATCH 00/10] unify origanization structure of block group cache damenly.su
2019-12-05  4:29 ` [PATCH 01/10] btrfs-progs: handle error if btrfs_write_one_block_group() failed damenly.su
2019-12-05  7:21   ` Qu Wenruo
2019-12-05  4:29 ` [PATCH 02/10] btrfs-progs: block_group: add rb tree related memebers damenly.su
2019-12-05  7:22   ` Qu Wenruo
2019-12-05  4:29 ` [PATCH 03/10] btrfs-progs: port block group cache tree insertion and lookup functions damenly.su
2019-12-05  7:29   ` Qu Wenruo
2019-12-05  8:32     ` Su Yue
2019-12-05 13:41       ` David Sterba
2019-12-05  4:29 ` [PATCH 04/10] btrfs-progs: reform the function block_group_cache_tree_search() damenly.su
2019-12-05  7:38   ` Qu Wenruo
2019-12-05  8:08     ` Su Yue
2019-12-05  4:29 ` [PATCH 05/10] btrfs-progs: adjust function btrfs_lookup_first_block_group_kernel damenly.su
2019-12-05  7:40   ` Qu Wenruo
2019-12-05  8:20     ` Su Yue
2019-12-05  4:29 ` [PATCH 06/10] btrfs-progs: abstract function btrfs_add_block_group_cache() damenly.su
2019-12-05  7:42   ` Qu Wenruo
2019-12-05  4:29 ` [PATCH 07/10] block-progs: block_group: add dirty_bgs list related memebers damenly.su
2019-12-05  7:43   ` Qu Wenruo
2019-12-05  4:29 ` [PATCH 08/10] btrfs-progs: pass @trans to functions touch dirty block groups damenly.su
2019-12-05  7:44   ` Qu Wenruo
2019-12-05  4:29 ` [PATCH 09/10] btrfs-progs: refrom block groups caches structure damenly.su
2019-12-05  7:51   ` Qu Wenruo
2019-12-05  8:09     ` Su Yue
2019-12-05  4:29 ` damenly.su [this message]
2019-12-05  7:52   ` [PATCH 10/10] btrfs-progs: cleanups after block group cache reform Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191205042921.25316-11-Damenly_Su@gmx.com \
    --to=damenly.su@gmail.com \
    --cc=Damenly_Su@gmx.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox