summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/bcachefs.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-09-26 00:18:48 +0200
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 23:09:41 +0200
commitdbb9936b0dc905657db6e5289be18e425f1b60d3 (patch)
tree62b0e09a54fe6e52323bddbf455dc034ae6b8caa /fs/bcachefs/bcachefs.h
parentbcachefs: bch2_print_string_as_lines() (diff)
downloadlinux-dbb9936b0dc905657db6e5289be18e425f1b60d3.tar.xz
linux-dbb9936b0dc905657db6e5289be18e425f1b60d3.zip
bcachefs: Improve bch2_fsck_err()
- factor out fsck_err_get() - if the "bcachefs (%s):" prefix has already been applied, don't duplicate it - convert to printbufs instead of static char arrays - tidy up control flow a bit - use bch2_print_string_as_lines(), to avoid messages getting truncated Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs.h')
-rw-r--r--fs/bcachefs/bcachefs.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h
index 74da688d994b..08fd899d8837 100644
--- a/fs/bcachefs/bcachefs.h
+++ b/fs/bcachefs/bcachefs.h
@@ -226,9 +226,11 @@ do { \
dynamic_fault("bcachefs:meta:write:" name)
#ifdef __KERNEL__
-#define bch2_fmt(_c, fmt) "bcachefs (%s): " fmt "\n", ((_c)->name)
+#define bch2_log_msg(_c, fmt) "bcachefs (%s): " fmt, ((_c)->name)
+#define bch2_fmt(_c, fmt) bch2_log_msg(_c, fmt "\n")
#define bch2_fmt_inum(_c, _inum, fmt) "bcachefs (%s inum %llu): " fmt "\n", ((_c)->name), (_inum)
#else
+#define bch2_log_msg(_c, fmt) fmt
#define bch2_fmt(_c, fmt) fmt "\n"
#define bch2_fmt_inum(_c, _inum, fmt) "inum %llu: " fmt "\n", (_inum)
#endif