summaryrefslogtreecommitdiff
path: root/libbcachefs/alloc_foreground.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/alloc_foreground.c')
-rw-r--r--libbcachefs/alloc_foreground.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/libbcachefs/alloc_foreground.c b/libbcachefs/alloc_foreground.c
index f6ea4a82..97b627ed 100644
--- a/libbcachefs/alloc_foreground.c
+++ b/libbcachefs/alloc_foreground.c
@@ -1491,10 +1491,9 @@ static void bch2_write_point_to_text(struct printbuf *out, struct bch_fs *c,
prt_newline(out);
- printbuf_indent_add(out, 2);
- open_bucket_for_each(c, &wp->ptrs, ob, i)
- bch2_open_bucket_to_text(out, c, ob);
- printbuf_indent_sub(out, 2);
+ scoped_guard(printbuf_indent, out)
+ open_bucket_for_each(c, &wp->ptrs, ob, i)
+ bch2_open_bucket_to_text(out, c, ob);
}
void bch2_write_points_to_text(struct printbuf *out, struct bch_fs *c)
@@ -1530,6 +1529,7 @@ void bch2_fs_alloc_debug_to_text(struct printbuf *out, struct bch_fs *c)
printbuf_tabstop_push(out, 24);
prt_printf(out, "capacity\t%llu\n", c->capacity);
+ prt_printf(out, "used\t%llu\n", bch2_fs_usage_read_short(c).used);
prt_printf(out, "reserved\t%llu\n", c->reserved);
prt_printf(out, "hidden\t%llu\n", percpu_u64_get(&c->usage->hidden));
prt_printf(out, "btree\t%llu\n", percpu_u64_get(&c->usage->btree));
@@ -1586,9 +1586,8 @@ static noinline void bch2_print_allocator_stuck(struct bch_fs *c)
c->opts.allocator_stuck_timeout);
prt_printf(&buf, "Allocator debug:\n");
- printbuf_indent_add(&buf, 2);
- bch2_fs_alloc_debug_to_text(&buf, c);
- printbuf_indent_sub(&buf, 2);
+ scoped_guard(printbuf_indent, &buf)
+ bch2_fs_alloc_debug_to_text(&buf, c);
prt_newline(&buf);
bch2_printbuf_make_room(&buf, 4096);
@@ -1597,23 +1596,20 @@ static noinline void bch2_print_allocator_stuck(struct bch_fs *c)
guard(printbuf_atomic)(&buf);
for_each_online_member_rcu(c, ca) {
prt_printf(&buf, "Dev %u:\n", ca->dev_idx);
- printbuf_indent_add(&buf, 2);
- bch2_dev_alloc_debug_to_text(&buf, ca);
- printbuf_indent_sub(&buf, 2);
+ scoped_guard(printbuf_indent, &buf)
+ bch2_dev_alloc_debug_to_text(&buf, ca);
prt_newline(&buf);
}
}
prt_printf(&buf, "Copygc debug:\n");
- printbuf_indent_add(&buf, 2);
- bch2_copygc_wait_to_text(&buf, c);
- printbuf_indent_sub(&buf, 2);
+ scoped_guard(printbuf_indent, &buf)
+ bch2_copygc_wait_to_text(&buf, c);
prt_newline(&buf);
prt_printf(&buf, "Journal debug:\n");
- printbuf_indent_add(&buf, 2);
- bch2_journal_debug_to_text(&buf, &c->journal);
- printbuf_indent_sub(&buf, 2);
+ scoped_guard(printbuf_indent, &buf)
+ bch2_journal_debug_to_text(&buf, &c->journal);
bch2_print_str(c, KERN_ERR, buf.buf);
}