Skip to contentSkip to conversation

btrfs-progs: check/original: Remove unused variable first_key

PATCH Applied Qu Wenruo 2 participants 2 messages Mar 22, 2018 – Mar 26, 2018 Btrfs file system

lore
Share & tools
lore

Qu Wenruo

author
#0 lore raw

PATCH 1/1 btrfs-progs: check/original: Remove unused variable first_key

This @first_key variable is introduced in f5c4c4f3b75b ("btrfsck: add code to rebuild extent records"), however it's not only unused, but also used incorrectly.

It's calling btrfs_item_key_to_cpu() on an node extent buffer.

Anyway, just remove it.

Fixes f5c4c4f3b75b ("btrfsck: add code to rebuild extent records")
---
 check/main.c | 5 -----
 1 file changed, 5 deletions(-)
check/main.c +0 -5
index b476e07ba9e7..891a6d797756 100644
@@ -6103,12 +6103,7 @@ static int run_next_block(struct btrfs_root *root,
 		}
 	} else {
 		int level;
-		struct btrfs_key first_key;
 
-		first_key.objectid = 0;
-
-		if (nritems > 0)
-			btrfs_item_key_to_cpu(buf, &first_key, 0);
 		level = btrfs_header_level(buf);
 		for (i = 0; i < nritems; i++) {
 			struct extent_record tmpl;
Signature · 1 line
2.16.2
Applied
#1 lore raw
Quoted 10 lines · Qu Wenruo

This @first_key variable is introduced in f5c4c4f3b75b ("btrfsck: add code to rebuild extent records"), however it's not only unused, but also used incorrectly.

It's calling btrfs_item_key_to_cpu() on an node extent buffer.

Anyway, just remove it.

Fixes f5c4c4f3b75b ("btrfsck: add code to rebuild extent records")

Applied, thanks.