Commit 0acb385e authored by Alan Huang's avatar Alan Huang Committed by Kent Overstreet
Browse files
parent 3315113a
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -296,7 +296,6 @@ do { \
#define bch2_fmt(_c, fmt)		bch2_log_msg(_c, fmt "\n")

void bch2_print_str(struct bch_fs *, const char *, const char *);
void bch2_print_str_nonblocking(struct bch_fs *, const char *, const char *);

__printf(2, 3)
void bch2_print_opts(struct bch_opts *, const char *, ...);
+1 −1
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ static noinline __noreturn void break_cycle_fail(struct lock_graph *g)
		prt_newline(&buf);
	}

	bch2_print_str_nonblocking(g->g->trans->c, KERN_ERR, buf.buf);
	bch2_print_str(g->g->trans->c, KERN_ERR, buf.buf);
	printbuf_exit(&buf);
	BUG();
}
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ static bool bch2_fs_trans_inconsistent(struct bch_fs *c, struct btree_trans *tra
	if (trans)
		bch2_trans_updates_to_text(&buf, trans);
	bool ret = __bch2_inconsistent_error(c, &buf);
	bch2_print_str_nonblocking(c, KERN_ERR, buf.buf);
	bch2_print_str(c, KERN_ERR, buf.buf);

	printbuf_exit(&buf);
	return ret;
+3 −8
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ const char * const bch2_dev_write_refs[] = {
#undef x

static void __bch2_print_str(struct bch_fs *c, const char *prefix,
			     const char *str, bool nonblocking)
			     const char *str)
{
#ifdef __KERNEL__
	struct stdio_redirect *stdio = bch2_fs_stdio_redirect(c);
@@ -114,17 +114,12 @@ static void __bch2_print_str(struct bch_fs *c, const char *prefix,
		return;
	}
#endif
	bch2_print_string_as_lines(KERN_ERR, str, nonblocking);
	bch2_print_string_as_lines(KERN_ERR, str);
}

void bch2_print_str(struct bch_fs *c, const char *prefix, const char *str)
{
	__bch2_print_str(c, prefix, str, false);
}

void bch2_print_str_nonblocking(struct bch_fs *c, const char *prefix, const char *str)
{
	__bch2_print_str(c, prefix, str, true);
	__bch2_print_str(c, prefix, str);
}

__printf(2, 0)
+2 −8
Original line number Diff line number Diff line
@@ -262,8 +262,7 @@ static bool string_is_spaces(const char *str)
	return true;
}

void bch2_print_string_as_lines(const char *prefix, const char *lines,
				bool nonblocking)
void bch2_print_string_as_lines(const char *prefix, const char *lines)
{
	bool locked = false;
	const char *p;
@@ -273,12 +272,7 @@ void bch2_print_string_as_lines(const char *prefix, const char *lines,
		return;
	}

	if (!nonblocking) {
		console_lock();
		locked = true;
	} else {
	locked = console_trylock();
	}

	while (*lines) {
		p = strchrnul(lines, '\n');
Loading