From 56917b41fb55a66e6664929c16dcb86f05d77fe3 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 2 Nov 2016 10:50:40 +0100 Subject: btrfs-progs: dump-tree: move remaining item variables to the scope of use Signed-off-by: David Sterba --- print-tree.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/print-tree.c b/print-tree.c index 8d622942..89a0e823 100644 --- a/print-tree.c +++ b/print-tree.c @@ -1032,12 +1032,6 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *eb) struct btrfs_item *item; struct btrfs_disk_key disk_key; u32 nr = btrfs_header_nritems(eb); - u64 objectid; - u32 type; - u64 offset; - char flags_str[256]; - char uuid_str[BTRFS_UUID_UNPARSED_SIZE]; - u8 uuid[BTRFS_UUID_SIZE]; printf("leaf %llu items %d free space %d generation %llu owner %llu\n", (unsigned long long)btrfs_header_bytenr(eb), nr, @@ -1049,15 +1043,23 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *eb) for (i = 0 ; i < nr ; i++) { u32 item_size; void *ptr; + u64 objectid; + u32 type; + u64 offset; + char flags_str[256]; + char uuid_str[BTRFS_UUID_UNPARSED_SIZE]; + u8 uuid[BTRFS_UUID_SIZE]; item = btrfs_item_nr(i); item_size = btrfs_item_size(eb, item); /* Untyped extraction of slot from btrfs_item_ptr */ ptr = btrfs_item_ptr(eb, i, void*); + btrfs_item_key(eb, &disk_key, i); objectid = btrfs_disk_key_objectid(&disk_key); type = btrfs_disk_key_type(&disk_key); offset = btrfs_disk_key_offset(&disk_key); + printf("\titem %d ", i); btrfs_print_key(&disk_key); printf(" itemoff %d itemsize %d\n", -- cgit v1.2.3