diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-10 22:08:24 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-08 23:29:17 +0200 |
commit | 7423330e30ab916d56ce9a9d49e37e40ead5b153 (patch) | |
tree | 16ea8f07f0ec544901be73b749629e136bf59285 /fs/bcachefs/sb-counters.c | |
parent | bcachefs: printbufs: prt_printf() now handles \t\r\n (diff) | |
download | linux-7423330e30ab916d56ce9a9d49e37e40ead5b153.tar.xz linux-7423330e30ab916d56ce9a9d49e37e40ead5b153.zip |
bcachefs: prt_printf() now respects \r\n\t
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/sb-counters.c')
-rw-r--r-- | fs/bcachefs/sb-counters.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/bcachefs/sb-counters.c b/fs/bcachefs/sb-counters.c index 7dc898761bb3..7282f7886192 100644 --- a/fs/bcachefs/sb-counters.c +++ b/fs/bcachefs/sb-counters.c @@ -31,19 +31,12 @@ static void bch2_sb_counters_to_text(struct printbuf *out, struct bch_sb *sb, struct bch_sb_field *f) { struct bch_sb_field_counters *ctrs = field_to_type(f, counters); - unsigned int i; unsigned int nr = bch2_sb_counter_nr_entries(ctrs); - for (i = 0; i < nr; i++) { - if (i < BCH_COUNTER_NR) - prt_printf(out, "%s ", bch2_counter_names[i]); - else - prt_printf(out, "(unknown)"); - - prt_tab(out); - prt_printf(out, "%llu", le64_to_cpu(ctrs->d[i])); - prt_newline(out); - } + for (unsigned i = 0; i < nr; i++) + prt_printf(out, "%s \t%llu\n", + i < BCH_COUNTER_NR ? bch2_counter_names[i] : "(unknown)", + le64_to_cpu(ctrs->d[i])); }; int bch2_sb_counters_to_cpu(struct bch_fs *c) |