- printf("\n");
- printf_pad(20, "%s (device %u):", d->label ?: "(no label)", d->idx);
- printf("%30s%16s\n", d->dev ?: "(device not found)", bch2_dev_state[u.state]);
-
- printf("%-20s%16s%16s%16s\n",
- "", "data", "buckets", "fragmented");
-
- for (i = BCH_DATA_sb; i < BCH_DATA_NR; i++)
- print_dev_usage_type(bch2_data_types[i],
- u.bucket_size,
- u.buckets[i],
- u.sectors[i],
- units);
-
- print_dev_usage_type("erasure coded",
- u.bucket_size,
- u.ec_buckets,
- u.ec_sectors,
- units);
-
- printf_pad(20, " available:");
- printf(" %15s %15llu\n",
- pr_units(u.available_buckets * u.bucket_size, units),
- u.available_buckets);
-
- printf_pad(20, " capacity:");
- printf(" %15s %15llu\n",
- pr_units(u.nr_buckets * u.bucket_size, units),
- u.nr_buckets);
+ prt_newline(out);
+ prt_printf(out, "%s (device %u):", d->label ?: "(no label)", d->idx);
+ prt_tab(out);
+ prt_str(out, d->dev ?: "(device not found)");
+ prt_tab_rjust(out);
+
+ prt_str(out, bch2_member_states[u.state]);
+ prt_tab_rjust(out);
+
+ prt_newline(out);
+
+ printbuf_indent_add(out, 2);
+ prt_tab(out);
+
+ prt_str(out, "data");
+ prt_tab_rjust(out);
+
+ prt_str(out, "buckets");
+ prt_tab_rjust(out);
+
+ prt_str(out, "fragmented");
+ prt_tab_rjust(out);
+
+ prt_newline(out);
+
+ for (i = 0; i < BCH_DATA_NR; i++)
+ dev_usage_type_to_text(out, &u, i);
+ __dev_usage_type_to_text(out, "erasure coded",
+ u.bucket_size,
+ u.buckets_ec, u.buckets_ec * u.bucket_size, 0);
+
+ prt_str(out, "capacity:");
+ prt_tab(out);
+
+ prt_units_u64(out, (u.nr_buckets * u.bucket_size) << 9);
+ prt_tab_rjust(out);
+ prt_printf(out, "%llu", u.nr_buckets);
+ prt_tab_rjust(out);
+
+ printbuf_indent_sub(out, 2);
+
+ prt_newline(out);