[03/10] btrfs-progs: remove deadcode around metadump_v2 in check_chunk_refs
diff mbox

Message ID 1445254680-11102-4-git-send-email-guaneryu@gmail.com
State New
Headers show

Commit Message

Eryu Guan Oct. 19, 2015, 11:37 a.m. UTC
metadump_v2 is initialized to 0 and never updated again. So remove the
deadcode.

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
---

I'm not sure about this one, seems metadump_v2 should be initialized depending
on whether superblock has BTRFS_SUPER_FLAG_METADUMP_V2 flag set.

 cmds-check.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

David Sterba Oct. 19, 2015, 1:45 p.m. UTC | #1
On Mon, Oct 19, 2015 at 07:37:53PM +0800, Eryu Guan wrote:
> metadump_v2 is initialized to 0 and never updated again. So remove the
> deadcode.

Josef introduced the v2 metadump to resolve some issues with the v1
format. Even if the code appears dead, I think it's "not yet used", but
I don't know what were the intentions with it.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/cmds-check.c b/cmds-check.c
index 80a7c29..118a274 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -7597,7 +7597,6 @@  static int check_chunk_refs(struct chunk_record *chunk_rec,
 	u64 devid;
 	u64 offset;
 	u64 length;
-	int metadump_v2 = 0;
 	int i;
 	int ret = 0;
 
@@ -7610,8 +7609,7 @@  static int check_chunk_refs(struct chunk_record *chunk_rec,
 					       cache);
 		if (chunk_rec->length != block_group_rec->offset ||
 		    chunk_rec->offset != block_group_rec->objectid ||
-		    (!metadump_v2 &&
-		     chunk_rec->type_flags != block_group_rec->flags)) {
+		    chunk_rec->type_flags != block_group_rec->flags) {
 			if (!silent)
 				fprintf(stderr,
 					"Chunk[%llu, %u, %llu]: length(%llu), offset(%llu), type(%llu) mismatch with block group[%llu, %u, %llu]: offset(%llu), objectid(%llu), flags(%llu)\n",
@@ -7645,9 +7643,6 @@  static int check_chunk_refs(struct chunk_record *chunk_rec,
 		ret = 1;
 	}
 
-	if (metadump_v2)
-		return ret;
-
 	length = calc_stripe_length(chunk_rec->type_flags, chunk_rec->length,
 				    chunk_rec->num_stripes);
 	for (i = 0; i < chunk_rec->num_stripes; ++i) {