aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@sandeen.net>2007-10-11 21:13:08 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-07 02:13:05 -0500
commitd4f3cc016fd6b392d483adc586b6dfaabad081af (patch)
tree6ccd74879d21159fb23f94c893142697eacac803 /fs
parent91906a882a4c9541317bc4f4c7fa5d8b784ba198 (diff)
[XFS] lose xfs_hex_dump in favor of print_hex_dump
No need for xfs to have its own hex dumping routine now that the kernel has one. SGI-PV: 971186 SGI-Modid: xfs-linux-melb:xfs-kern:29847a Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/support/debug.c6
-rw-r--r--fs/xfs/xfs_error.c31
-rw-r--r--fs/xfs/xfs_error.h2
3 files changed, 8 insertions, 31 deletions
diff --git a/fs/xfs/support/debug.c b/fs/xfs/support/debug.c
index fa4fb1820e75..c27abef7b84f 100644
--- a/fs/xfs/support/debug.c
+++ b/fs/xfs/support/debug.c
@@ -80,3 +80,9 @@ assfail(char *expr, char *file, int line)
80 printk("Assertion failed: %s, file: %s, line: %d\n", expr, file, line); 80 printk("Assertion failed: %s, file: %s, line: %d\n", expr, file, line);
81 BUG(); 81 BUG();
82} 82}
83
84void
85xfs_hex_dump(void *p, int length)
86{
87 print_hex_dump(KERN_ALERT, "", DUMP_PREFIX_OFFSET, 16, 1, p, length, 1);
88}
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
index a4634d94e561..05e5365d3c31 100644
--- a/fs/xfs/xfs_error.c
+++ b/fs/xfs/xfs_error.c
@@ -230,37 +230,6 @@ xfs_error_report(
230 } 230 }
231} 231}
232 232
233STATIC void
234xfs_hex_dump(void *p, int length)
235{
236 __uint8_t *uip = (__uint8_t*)p;
237 int i;
238 char sbuf[128], *s;
239
240 s = sbuf;
241 *s = '\0';
242 for (i=0; i<length; i++, uip++) {
243 if ((i % 16) == 0) {
244 if (*s != '\0')
245 cmn_err(CE_ALERT, "%s\n", sbuf);
246 s = sbuf;
247 sprintf(s, "0x%x: ", i);
248 while( *s != '\0')
249 s++;
250 }
251 sprintf(s, "%02x ", *uip);
252
253 /*
254 * the kernel sprintf is a void; user sprintf returns
255 * the sprintf'ed string's length. Find the new end-
256 * of-string
257 */
258 while( *s != '\0')
259 s++;
260 }
261 cmn_err(CE_ALERT, "%s\n", sbuf);
262}
263
264void 233void
265xfs_corruption_error( 234xfs_corruption_error(
266 char *tag, 235 char *tag,
diff --git a/fs/xfs/xfs_error.h b/fs/xfs/xfs_error.h
index 10e9d9619ae5..6490d2a9f8e1 100644
--- a/fs/xfs/xfs_error.h
+++ b/fs/xfs/xfs_error.h
@@ -174,6 +174,8 @@ extern void xfs_cmn_err(int panic_tag, int level, struct xfs_mount *mp,
174/* PRINTFLIKE3 */ 174/* PRINTFLIKE3 */
175extern void xfs_fs_cmn_err(int level, struct xfs_mount *mp, char *fmt, ...); 175extern void xfs_fs_cmn_err(int level, struct xfs_mount *mp, char *fmt, ...);
176 176
177extern void xfs_hex_dump(void *p, int length);
178
177#define xfs_fs_repair_cmn_err(level, mp, fmt, args...) \ 179#define xfs_fs_repair_cmn_err(level, mp, fmt, args...) \
178 xfs_fs_cmn_err(level, mp, fmt " Unmount and run xfs_repair.", ## args) 180 xfs_fs_cmn_err(level, mp, fmt " Unmount and run xfs_repair.", ## args)
179 181