Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfs: make the assertion message functions take a mount parameter

Make the assfail and asswarn functions take a struct xfs_mount so that
we can start tying debugging and corruption messages to a particular
mount.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>

+17 -9
+3 -3
fs/xfs/xfs_linux.h
··· 223 223 char *data, unsigned int op); 224 224 225 225 #define ASSERT_ALWAYS(expr) \ 226 - (likely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__)) 226 + (likely(expr) ? (void)0 : assfail(NULL, #expr, __FILE__, __LINE__)) 227 227 228 228 #ifdef DEBUG 229 229 #define ASSERT(expr) \ 230 - (likely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__)) 230 + (likely(expr) ? (void)0 : assfail(NULL, #expr, __FILE__, __LINE__)) 231 231 232 232 #else /* !DEBUG */ 233 233 234 234 #ifdef XFS_WARN 235 235 236 236 #define ASSERT(expr) \ 237 - (likely(expr) ? (void)0 : asswarn(#expr, __FILE__, __LINE__)) 237 + (likely(expr) ? (void)0 : asswarn(NULL, #expr, __FILE__, __LINE__)) 238 238 239 239 #else /* !DEBUG && !XFS_WARN */ 240 240
+12 -4
fs/xfs/xfs_message.c
··· 86 86 } 87 87 88 88 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) 90 94 { 91 - xfs_warn(NULL, "Assertion failed: %s, file: %s, line: %d", 95 + xfs_warn(mp, "Assertion failed: %s, file: %s, line: %d", 92 96 expr, file, line); 93 97 WARN_ON(1); 94 98 } 95 99 96 100 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) 98 106 { 99 - xfs_emerg(NULL, "Assertion failed: %s, file: %s, line: %d", 107 + xfs_emerg(mp, "Assertion failed: %s, file: %s, line: %d", 100 108 expr, file, line); 101 109 if (xfs_globals.bug_on_assert) 102 110 BUG();
+2 -2
fs/xfs/xfs_message.h
··· 57 57 #define xfs_debug_ratelimited(dev, fmt, ...) \ 58 58 xfs_printk_ratelimited(xfs_debug, dev, fmt, ##__VA_ARGS__) 59 59 60 - extern void assfail(char *expr, char *f, int l); 61 - extern void asswarn(char *expr, char *f, int l); 60 + void assfail(struct xfs_mount *mp, char *expr, char *f, int l); 61 + void asswarn(struct xfs_mount *mp, char *expr, char *f, int l); 62 62 63 63 extern void xfs_hex_dump(const void *p, int length); 64 64