diff options
author | David Sterba <dsterba@suse.com> | 2017-08-31 17:07:00 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-09-08 16:15:05 +0200 |
commit | 8609c8bad68528f668d9ce564b868aa4828107a0 (patch) | |
tree | cddf5ec2ca521e6ec3a7e8adbeea9e5c77922868 /print-tree.c | |
parent | a4b65f00d53deb1b495728dd58253af44fcf70df (diff) |
btrfs-progs: print-tree: factor out temporary_item dump
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'print-tree.c')
-rw-r--r-- | print-tree.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/print-tree.c b/print-tree.c index 3df005b3..b4da3850 100644 --- a/print-tree.c +++ b/print-tree.c @@ -1087,6 +1087,21 @@ static void print_persistent_item(struct extent_buffer *eb, void *ptr, } } +static void print_temporary_item(struct extent_buffer *eb, void *ptr, + u64 objectid, u64 offset) +{ + printf("\t\ttemporary item objectid "); + print_objectid(stdout, objectid, BTRFS_TEMPORARY_ITEM_KEY); + printf(" offset %llu\n", (unsigned long long)offset); + switch (objectid) { + case BTRFS_BALANCE_OBJECTID: + print_balance_item(eb, ptr); + break; + default: + printf("\t\tunknown temporary item objectid %llu\n", objectid); + } +} + /* Caller must ensure sizeof(*ret) >= 14 "WRITTEN|RELOC" */ static void header_flags_to_str(u64 flags, char *ret) { @@ -1272,17 +1287,7 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *eb) offset); break; case BTRFS_TEMPORARY_ITEM_KEY: - printf("\t\ttemporary item objectid "); - print_objectid(stdout, objectid, BTRFS_TEMPORARY_ITEM_KEY); - printf(" offset %llu\n", (unsigned long long)offset); - switch (objectid) { - case BTRFS_BALANCE_OBJECTID: - print_balance_item(eb, ptr); - break; - default: - printf("\t\tunknown temporary item objectid %llu\n", - objectid); - } + print_temporary_item(eb, ptr, objectid, offset); break; }; fflush(stdout); |