@@ -247,7 +247,7 @@ static void journal_entry_err_msg(struct printbuf *out,
247247
248248 if (entry ) {
249249 prt_str (out , " type=" );
250- prt_str (out , bch2_jset_entry_types [ entry -> type ] );
250+ bch2_prt_jset_entry_type (out , entry -> type );
251251 }
252252
253253 if (!jset ) {
@@ -403,7 +403,8 @@ static void journal_entry_btree_keys_to_text(struct printbuf *out, struct bch_fs
403403 jset_entry_for_each_key (entry , k ) {
404404 if (!first ) {
405405 prt_newline (out );
406- prt_printf (out , "%s: " , bch2_jset_entry_types [entry -> type ]);
406+ bch2_prt_jset_entry_type (out , entry -> type );
407+ prt_str (out , ": " );
407408 }
408409 prt_printf (out , "btree=%s l=%u " , bch2_btree_id_str (entry -> btree_id ), entry -> level );
409410 bch2_bkey_val_to_text (out , c , bkey_i_to_s_c (k ));
@@ -563,9 +564,9 @@ static void journal_entry_usage_to_text(struct printbuf *out, struct bch_fs *c,
563564 struct jset_entry_usage * u =
564565 container_of (entry , struct jset_entry_usage , entry );
565566
566- prt_printf (out , "type=%s v=%llu" ,
567- bch2_fs_usage_types [ u -> entry .btree_id ],
568- le64_to_cpu (u -> v ));
567+ prt_str (out , "type=" );
568+ bch2_prt_fs_usage_type ( out , u -> entry .btree_id );
569+ prt_printf ( out , " v=%llu" , le64_to_cpu (u -> v ));
569570}
570571
571572static int journal_entry_data_usage_validate (struct bch_fs * c ,
@@ -827,11 +828,11 @@ int bch2_journal_entry_validate(struct bch_fs *c,
827828void bch2_journal_entry_to_text (struct printbuf * out , struct bch_fs * c ,
828829 struct jset_entry * entry )
829830{
831+ bch2_prt_jset_entry_type (out , entry -> type );
832+
830833 if (entry -> type < BCH_JSET_ENTRY_NR ) {
831- prt_printf (out , "%s : " , bch2_jset_entry_types [ entry -> type ] );
834+ prt_str (out , ": " );
832835 bch2_jset_entry_ops [entry -> type ].to_text (out , c , entry );
833- } else {
834- prt_printf (out , "(unknown type %u)" , entry -> type );
835836 }
836837}
837838
0 commit comments