hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/fs/xfs/xfs_message.c
....@@ -6,8 +6,8 @@
66 #include "xfs.h"
77 #include "xfs_fs.h"
88 #include "xfs_error.h"
9
+#include "xfs_shared.h"
910 #include "xfs_format.h"
10
-#include "xfs_log_format.h"
1111 #include "xfs_trans_resv.h"
1212 #include "xfs_mount.h"
1313
....@@ -20,8 +20,8 @@
2020 const struct xfs_mount *mp,
2121 struct va_format *vaf)
2222 {
23
- if (mp && mp->m_fsname) {
24
- printk("%sXFS (%s): %pV\n", level, mp->m_fsname, vaf);
23
+ if (mp && mp->m_super) {
24
+ printk("%sXFS (%s): %pV\n", level, mp->m_super->s_id, vaf);
2525 return;
2626 }
2727 printk("%sXFS: %pV\n", level, vaf);
....@@ -86,17 +86,25 @@
8686 }
8787
8888 void
89
-asswarn(char *expr, char *file, int line)
89
+asswarn(
90
+ struct xfs_mount *mp,
91
+ char *expr,
92
+ char *file,
93
+ int line)
9094 {
91
- xfs_warn(NULL, "Assertion failed: %s, file: %s, line: %d",
95
+ xfs_warn(mp, "Assertion failed: %s, file: %s, line: %d",
9296 expr, file, line);
9397 WARN_ON(1);
9498 }
9599
96100 void
97
-assfail(char *expr, char *file, int line)
101
+assfail(
102
+ struct xfs_mount *mp,
103
+ char *expr,
104
+ char *file,
105
+ int line)
98106 {
99
- xfs_emerg(NULL, "Assertion failed: %s, file: %s, line: %d",
107
+ xfs_emerg(mp, "Assertion failed: %s, file: %s, line: %d",
100108 expr, file, line);
101109 if (xfs_globals.bug_on_assert)
102110 BUG();
....@@ -105,7 +113,29 @@
105113 }
106114
107115 void
108
-xfs_hex_dump(void *p, int length)
116
+xfs_hex_dump(const void *p, int length)
109117 {
110
- print_hex_dump(KERN_ALERT, "", DUMP_PREFIX_ADDRESS, 16, 1, p, length, 1);
118
+ print_hex_dump(KERN_ALERT, "", DUMP_PREFIX_OFFSET, 16, 1, p, length, 1);
119
+}
120
+
121
+void
122
+xfs_buf_alert_ratelimited(
123
+ struct xfs_buf *bp,
124
+ const char *rlmsg,
125
+ const char *fmt,
126
+ ...)
127
+{
128
+ struct xfs_mount *mp = bp->b_mount;
129
+ struct va_format vaf;
130
+ va_list args;
131
+
132
+ /* use the more aggressive per-target rate limit for buffers */
133
+ if (!___ratelimit(&bp->b_target->bt_ioerror_rl, rlmsg))
134
+ return;
135
+
136
+ va_start(args, fmt);
137
+ vaf.fmt = fmt;
138
+ vaf.va = &args;
139
+ __xfs_printk(KERN_ALERT, mp, &vaf);
140
+ va_end(args);
111141 }