diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-08-11 21:06:02 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:38 -0400 |
commit | ff7dc3651d5bdcc9d9fe4ace3da21f0f5c2bd778 (patch) | |
tree | b564cbe8f4b3e0849467d2884f8744d7a13e4ca6 /fs/bcachefs/debug.c | |
parent | 5c0bb66ae341c71e5f62c193ea4d7b0cf278a914 (diff) | |
download | linux-ff7dc3651d5bdcc9d9fe4ace3da21f0f5c2bd778.tar.gz linux-ff7dc3651d5bdcc9d9fe4ace3da21f0f5c2bd778.tar.bz2 linux-ff7dc3651d5bdcc9d9fe4ace3da21f0f5c2bd778.zip |
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>
Diffstat (limited to 'fs/bcachefs/debug.c')
-rw-r--r-- | fs/bcachefs/debug.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c index c982b0d80c91..183e9f099ca9 100644 --- a/fs/bcachefs/debug.c +++ b/fs/bcachefs/debug.c @@ -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); |