summaryrefslogtreecommitdiff
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2022-10-19 10:50:50 -0400
committerDavid Sterba <dsterba@suse.com>2022-12-05 18:00:41 +0100
commitbbde07a40a13cc5a3483eaeb52e9bb3b61d2cf57 (patch)
tree1ba4f3a6ab5723edff3720274f891a454da8de04 /fs/btrfs/super.c
parent9b569ea0be6fb27a4985acc9325896a3edc95ede (diff)
btrfs: push printk index code into their respective helpers
The printk index work can be pushed into the printk helpers themselves, this allows us to further sanitize messages.h, removing the last include in the header itself. Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 7debbcfc5d47..3aeb2106e119 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -181,6 +181,12 @@ void __btrfs_handle_fs_error(struct btrfs_fs_info *fs_info, const char *function
const char *errstr;
#endif
+#ifdef CONFIG_PRINTK_INDEX
+ printk_index_subsys_emit(
+ "BTRFS: error (device %s%s) in %s:%d: errno=%d %s",
+ KERN_CRIT, fmt);
+#endif
+
/*
* Special case: if the error is EROFS, and we're already
* under SB_RDONLY, then it is safe here.
@@ -273,6 +279,10 @@ void __cold _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt,
const char *type = logtypes[4];
struct ratelimit_state *ratelimit = &printk_limits[4];
+#ifdef CONFIG_PRINTK_INDEX
+ printk_index_subsys_emit("%sBTRFS %s (device %s): ", NULL, fmt);
+#endif
+
va_start(args, fmt);
while ((kern_level = printk_get_level(fmt)) != 0) {