btrfs-progs: print-tree add missing DEV_STATS

Add missing BTRFS_DEV_STATS_OBJECTID into the print-tree.

before:
 	item 0 key (0 PERSISTENT_ITEM 1) itemoff 16243 itemsize 40
 		persistent item objectid 0 offset 1
after:
 	item 0 key (DEV_STATS PERSISTENT_ITEM 1) itemoff 16243 itemsize 40
 		persistent item objectid DEV_STATS offset 1

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Anand Jain 2019-08-28 17:56:19 +08:00 committed by David Sterba
parent d523a28a15
commit 9b1a1dacbc
1 changed files with 6 additions and 0 deletions

View File

@ -689,6 +689,12 @@ void print_key_type(FILE *stream, u64 objectid, u8 type)
void print_objectid(FILE *stream, u64 objectid, u8 type)
{
switch (type) {
case BTRFS_PERSISTENT_ITEM_KEY:
if (objectid == BTRFS_DEV_STATS_OBJECTID)
fprintf(stream, "DEV_STATS");
else
fprintf(stream, "%llu", (unsigned long long)objectid);
return;
case BTRFS_DEV_EXTENT_KEY:
/* device id */
fprintf(stream, "%llu", (unsigned long long)objectid);