[PATCH 2/2] btrfs-progs: print-tree add missing DEV_STATS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 print-tree.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/print-tree.c b/print-tree.c
index 5832f3089e3d..0f9b3a8f0f83 100644
--- a/print-tree.c
+++ b/print-tree.c
@@ -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);
-- 
2.21.0 (Apple Git-120)




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux