Commit 5b883656 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: __bch2_sb_field_to_text()

parent 1f5af5fc
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -1187,7 +1187,7 @@ static int bch2_sb_field_validate(struct bch_sb *sb, struct bch_sb_field *f,
	return ret;
}

void bch2_sb_field_to_text(struct printbuf *out, struct bch_sb *sb,
void __bch2_sb_field_to_text(struct printbuf *out, struct bch_sb *sb,
			     struct bch_sb_field *f)
{
	unsigned type = le32_to_cpu(f->type);
@@ -1196,6 +1196,15 @@ void bch2_sb_field_to_text(struct printbuf *out, struct bch_sb *sb,
	if (!out->nr_tabstops)
		printbuf_tabstop_push(out, 32);

	if (ops->to_text)
		ops->to_text(out, sb, f);
}

void bch2_sb_field_to_text(struct printbuf *out, struct bch_sb *sb,
			   struct bch_sb_field *f)
{
	unsigned type = le32_to_cpu(f->type);

	if (type < BCH_SB_FIELD_NR)
		prt_printf(out, "%s", bch2_sb_fields[type]);
	else
@@ -1204,11 +1213,7 @@ void bch2_sb_field_to_text(struct printbuf *out, struct bch_sb *sb,
	prt_printf(out, " (size %zu):", vstruct_bytes(f));
	prt_newline(out);

	if (ops->to_text) {
		printbuf_indent_add(out, 2);
		ops->to_text(out, sb, f);
		printbuf_indent_sub(out, 2);
	}
	__bch2_sb_field_to_text(out, sb, f);
}

void bch2_sb_layout_to_text(struct printbuf *out, struct bch_sb_layout *l)
+2 −0
Original line number Diff line number Diff line
@@ -93,6 +93,8 @@ static inline void bch2_check_set_feature(struct bch_fs *c, unsigned feat)
bool bch2_check_version_downgrade(struct bch_fs *);
void bch2_sb_upgrade(struct bch_fs *, unsigned);

void __bch2_sb_field_to_text(struct printbuf *, struct bch_sb *,
			     struct bch_sb_field *);
void bch2_sb_field_to_text(struct printbuf *, struct bch_sb *,
			   struct bch_sb_field *);
void bch2_sb_layout_to_text(struct printbuf *, struct bch_sb_layout *);