Commit ff7dc365 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Print last line in debugfs/btree_transaction_stats

We need to turn the flush_buf() thing into a proper API, to replace
seq_file.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 5c0bb66a
......@@ -660,8 +660,7 @@ static ssize_t lock_held_stats_read(struct file *file, char __user *buf,
i->size = size;
i->ret = 0;
while (i->iter < ARRAY_SIZE(c->btree_transaction_fns) &&
c->btree_transaction_fns[i->iter]) {
while (1) {
struct btree_transaction_stats *s = &c->btree_transaction_stats[i->iter];
err = flush_buf(i);
......@@ -671,6 +670,10 @@ static ssize_t lock_held_stats_read(struct file *file, char __user *buf,
if (!i->size)
break;
if (i->iter == ARRAY_SIZE(c->btree_transaction_fns) ||
!c->btree_transaction_fns[i->iter])
break;
prt_printf(&i->buf, "%s: ", c->btree_transaction_fns[i->iter]);
prt_newline(&i->buf);
printbuf_indent_add(&i->buf, 2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment