summaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal_io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-02-16 02:50:39 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:24 -0400
commite7bc7cdff813719479d555d9a3ebb62bef3050ce (patch)
treeaccd056183f5fb35231659d3f80d89149aa4c3d4 /fs/bcachefs/journal_io.c
parent33aa419db96077993af90eddb49adac1270a96e0 (diff)
downloadlwn-e7bc7cdff813719479d555d9a3ebb62bef3050ce.tar.gz
lwn-e7bc7cdff813719479d555d9a3ebb62bef3050ce.zip
bcachefs: Improve journal_entry_btree_keys_to_text()
This improves the formatting of journal_entry_btree_keys_to_text() by putting each key on its own line. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/journal_io.c')
-rw-r--r--fs/bcachefs/journal_io.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c
index 75b805732c21..03bc94b586f2 100644
--- a/fs/bcachefs/journal_io.c
+++ b/fs/bcachefs/journal_io.c
@@ -298,11 +298,17 @@ static void journal_entry_btree_keys_to_text(struct printbuf *out, struct bch_fs
struct jset_entry *entry)
{
struct bkey_i *k;
+ bool first = true;
- pr_buf(out, "btree=%s l=%u ", bch2_btree_ids[entry->btree_id], entry->level);
-
- vstruct_for_each(entry, k)
+ vstruct_for_each(entry, k) {
+ if (!first) {
+ printbuf_newline(out);
+ pr_buf(out, "%s: ", bch2_jset_entry_types[entry->type]);
+ }
+ pr_buf(out, "btree=%s l=%u ", bch2_btree_ids[entry->btree_id], entry->level);
bch2_bkey_val_to_text(out, c, bkey_i_to_s_c(k));
+ first = false;
+ }
}
static int journal_entry_btree_root_validate(struct bch_fs *c,