mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-09 00:00:04 +03:00
Improve the list_journal subcommand
This updates list_journal to use the new bch2_journal_entry_to_text() pretty-printer. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
d08291637f
commit
a5bd96ff58
14
cmd_debug.c
14
cmd_debug.c
@ -595,9 +595,6 @@ int cmd_list_journal(int argc, char *argv[])
|
|||||||
|
|
||||||
struct journal_replay *p;
|
struct journal_replay *p;
|
||||||
struct jset_entry *entry;
|
struct jset_entry *entry;
|
||||||
struct bkey_i *k, *_n;
|
|
||||||
|
|
||||||
/* This could be greatly expanded: */
|
|
||||||
|
|
||||||
list_for_each_entry(p, &c->journal_entries, list) {
|
list_for_each_entry(p, &c->journal_entries, list) {
|
||||||
printf("journal entry %8llu\n"
|
printf("journal entry %8llu\n"
|
||||||
@ -608,14 +605,11 @@ int cmd_list_journal(int argc, char *argv[])
|
|||||||
le32_to_cpu(p->j.version),
|
le32_to_cpu(p->j.version),
|
||||||
le64_to_cpu(p->j.last_seq));
|
le64_to_cpu(p->j.last_seq));
|
||||||
|
|
||||||
for_each_jset_key(k, _n, entry, &p->j) {
|
vstruct_for_each(&p->j, entry) {
|
||||||
char buf[200];
|
char buf[500];
|
||||||
|
|
||||||
bch2_bkey_val_to_text(&PBUF(buf), c, bkey_i_to_s_c(k));
|
bch2_journal_entry_to_text(&PBUF(buf), c, entry);
|
||||||
printf("btree %s l %u: %s\n",
|
printf(" %s\n", buf);
|
||||||
bch2_btree_ids[entry->btree_id],
|
|
||||||
entry->level,
|
|
||||||
buf);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user