diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-09 00:04:31 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-08 17:29:17 -0400 |
commit | 6ab71b4a8e281f30a3dfd6f7831d9a2c67e162e4 (patch) | |
tree | c83020fea96b2f27a660bd16116fe8c1dfd64948 /fs/bcachefs/btree_journal_iter.c | |
parent | 9089376f709e726e9bd2914284b9b98af65de749 (diff) | |
download | lwn-6ab71b4a8e281f30a3dfd6f7831d9a2c67e162e4.tar.gz lwn-6ab71b4a8e281f30a3dfd6f7831d9a2c67e162e4.zip |
bcachefs: bch2_journal_keys_dump()
debug helper
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_journal_iter.c')
-rw-r--r-- | fs/bcachefs/btree_journal_iter.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_journal_iter.c b/fs/bcachefs/btree_journal_iter.c index 1e8cf49a6935..332dbf164929 100644 --- a/fs/bcachefs/btree_journal_iter.c +++ b/fs/bcachefs/btree_journal_iter.c @@ -623,3 +623,20 @@ void bch2_shoot_down_journal_keys(struct bch_fs *c, enum btree_id btree, keys->data[dst++] = *i; keys->nr = keys->gap = dst; } + +void bch2_journal_keys_dump(struct bch_fs *c) +{ + struct journal_keys *keys = &c->journal_keys; + struct printbuf buf = PRINTBUF; + + pr_info("%zu keys:", keys->nr); + + move_gap(keys, keys->nr); + + darray_for_each(*keys, i) { + printbuf_reset(&buf); + bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(i->k)); + pr_err("%s l=%u %s", bch2_btree_id_str(i->btree_id), i->level, buf.buf); + } + printbuf_exit(&buf); +} |