xfs: convert xfs_fs_cmn_err to new error logging API
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / fs / xfs / support / debug.c
bloba1c7141af481a0dad25fa541d1013e96df154ec4
1 /*
2 * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 #include <xfs.h>
19 #include "debug.h"
21 /* xfs_mount.h drags a lot of crap in, sorry.. */
22 #include "xfs_sb.h"
23 #include "xfs_inum.h"
24 #include "xfs_ag.h"
25 #include "xfs_mount.h"
26 #include "xfs_error.h"
28 void
29 cmn_err(
30 const char *lvl,
31 const char *fmt,
32 ...)
34 struct va_format vaf;
35 va_list args;
37 va_start(args, fmt);
38 vaf.fmt = fmt;
39 vaf.va = &args;
41 printk("%s%pV", lvl, &vaf);
42 va_end(args);
44 BUG_ON(strncmp(lvl, KERN_EMERG, strlen(KERN_EMERG)) == 0);
47 void
48 assfail(char *expr, char *file, int line)
50 printk(KERN_CRIT "Assertion failed: %s, file: %s, line: %d\n", expr,
51 file, line);
52 BUG();
55 void
56 xfs_hex_dump(void *p, int length)
58 print_hex_dump(KERN_ALERT, "", DUMP_PREFIX_ADDRESS, 16, 1, p, length, 1);