aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2011-03-06 18:09:35 -0500
committerDave Chinner <david@fromorbit.com>2011-03-06 18:09:35 -0500
commit9130090b5f04f7e7bc29b944e0b1ba494fff3f98 (patch)
tree54fafe352489be96c1796c022e431b97a5f48268 /fs/xfs/linux-2.6
parent0b932cccbdc09a72aa370456a59b40ecd6b10baf (diff)
xfs: kill support/debug.[ch]
The remaining functionality in debug.[ch] is effectively just assert handling, conditional debug definitions and hex dumping. The hex dumping and assert function can be moved into the new printk module, while the rest can be moved into top-level header files. This allows fs/xfs/support/debug.[ch] to be completely removed from the codebase. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Alex Elder <aelder@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/xfs_linux.h22
-rw-r--r--fs/xfs/linux-2.6/xfs_message.c14
-rw-r--r--fs/xfs/linux-2.6/xfs_message.h4
3 files changed, 39 insertions, 1 deletions
diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h
index 1189bfcbcd3e..244be9cbfe78 100644
--- a/fs/xfs/linux-2.6/xfs_linux.h
+++ b/fs/xfs/linux-2.6/xfs_linux.h
@@ -39,7 +39,6 @@
39#include <mrlock.h> 39#include <mrlock.h>
40#include <time.h> 40#include <time.h>
41 41
42#include <support/debug.h>
43#include <support/uuid.h> 42#include <support/uuid.h>
44 43
45#include <linux/semaphore.h> 44#include <linux/semaphore.h>
@@ -281,4 +280,25 @@ static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y)
281#define __arch_pack 280#define __arch_pack
282#endif 281#endif
283 282
283#define ASSERT_ALWAYS(expr) \
284 (unlikely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__))
285
286#ifndef DEBUG
287#define ASSERT(expr) ((void)0)
288
289#ifndef STATIC
290# define STATIC static noinline
291#endif
292
293#else /* DEBUG */
294
295#define ASSERT(expr) \
296 (unlikely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__))
297
298#ifndef STATIC
299# define STATIC noinline
300#endif
301
302#endif /* DEBUG */
303
284#endif /* __XFS_LINUX__ */ 304#endif /* __XFS_LINUX__ */
diff --git a/fs/xfs/linux-2.6/xfs_message.c b/fs/xfs/linux-2.6/xfs_message.c
index 6f3368eec25d..8fe8cf69d809 100644
--- a/fs/xfs/linux-2.6/xfs_message.c
+++ b/fs/xfs/linux-2.6/xfs_message.c
@@ -117,3 +117,17 @@ xfs_alert_tag(
117 117
118 return r; 118 return r;
119} 119}
120
121void
122assfail(char *expr, char *file, int line)
123{
124 xfs_emerg(NULL, "Assertion failed: %s, file: %s, line: %d",
125 expr, file, line);
126 BUG();
127}
128
129void
130xfs_hex_dump(void *p, int length)
131{
132 print_hex_dump(KERN_ALERT, "", DUMP_PREFIX_ADDRESS, 16, 1, p, length, 1);
133}
diff --git a/fs/xfs/linux-2.6/xfs_message.h b/fs/xfs/linux-2.6/xfs_message.h
index 8d2df0175304..e77ffa16745b 100644
--- a/fs/xfs/linux-2.6/xfs_message.h
+++ b/fs/xfs/linux-2.6/xfs_message.h
@@ -31,4 +31,8 @@ extern int xfs_debug(const struct xfs_mount *mp, const char *fmt, ...)
31#define xfs_debug(mp, fmt, ...) (0) 31#define xfs_debug(mp, fmt, ...) (0)
32#endif 32#endif
33 33
34extern void assfail(char *expr, char *f, int l);
35
36extern void xfs_hex_dump(void *p, int length);
37
34#endif /* __XFS_MESSAGE_H */ 38#endif /* __XFS_MESSAGE_H */