1

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: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
Kent Overstreet 2022-08-11 21:06:02 -04:00 committed by Kent Overstreet
parent 5c0bb66ae3
commit ff7dc3651d

View File

@ -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);