Skip to content

Commit 8ed4ba3

Browse files
author
Kent Overstreet
committed
bcachefs: Move tabstop setup to bch2_dev_usage_to_text()
No reason for it not to be where it's needed. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 4f19a60 commit 8ed4ba3

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

fs/bcachefs/alloc_foreground.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,13 +1729,6 @@ void bch2_dev_alloc_debug_to_text(struct printbuf *out, struct bch_dev *ca)
17291729
for (unsigned i = 0; i < ARRAY_SIZE(c->open_buckets); i++)
17301730
nr[c->open_buckets[i].data_type]++;
17311731

1732-
printbuf_tabstops_reset(out);
1733-
printbuf_tabstop_push(out, 12);
1734-
printbuf_tabstop_push(out, 16);
1735-
printbuf_tabstop_push(out, 16);
1736-
printbuf_tabstop_push(out, 16);
1737-
printbuf_tabstop_push(out, 16);
1738-
17391732
bch2_dev_usage_to_text(out, ca, &stats);
17401733

17411734
prt_newline(out);

fs/bcachefs/buckets.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ void bch2_dev_usage_to_text(struct printbuf *out,
7575
struct bch_dev *ca,
7676
struct bch_dev_usage *usage)
7777
{
78+
if (out->nr_tabstops < 5) {
79+
printbuf_tabstops_reset(out);
80+
printbuf_tabstop_push(out, 12);
81+
printbuf_tabstop_push(out, 16);
82+
printbuf_tabstop_push(out, 16);
83+
printbuf_tabstop_push(out, 16);
84+
printbuf_tabstop_push(out, 16);
85+
}
86+
7887
prt_printf(out, "\tbuckets\rsectors\rfragmented\r\n");
7988

8089
for (unsigned i = 0; i < BCH_DATA_NR; i++) {

0 commit comments

Comments
 (0)