summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 80071e23..3d0369f0 100644
--- a/utils.c
+++ b/utils.c
@@ -2716,3 +2716,21 @@ unsigned long total_memory(void)
}
return si.totalram * si.mem_unit; /* bytes */
}
+
+void print_device_info(struct btrfs_device *device, char *prefix)
+{
+ if (prefix)
+ printf("%s", prefix);
+ printf("Device: id = %llu, name = %s\n",
+ device->devid, device->name);
+}
+
+void print_all_devices(struct list_head *devices)
+{
+ struct btrfs_device *dev;
+
+ printf("All Devices:\n");
+ list_for_each_entry(dev, devices, dev_list)
+ print_device_info(dev, "\t");
+ printf("\n");
+}