Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84462
b: refs/heads/master
c: d4f3cc0
h: refs/heads/master
v: v3
  • Loading branch information
Eric Sandeen authored and Lachlan McIlroy committed Feb 7, 2008
1 parent 11510e7 commit 413eb82
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 91906a882a4c9541317bc4f4c7fa5d8b784ba198
refs/heads/master: d4f3cc016fd6b392d483adc586b6dfaabad081af
6 changes: 6 additions & 0 deletions trunk/fs/xfs/support/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,9 @@ assfail(char *expr, char *file, int line)
printk("Assertion failed: %s, file: %s, line: %d\n", expr, file, line);
BUG();
}

void
xfs_hex_dump(void *p, int length)
{
print_hex_dump(KERN_ALERT, "", DUMP_PREFIX_OFFSET, 16, 1, p, length, 1);
}
31 changes: 0 additions & 31 deletions trunk/fs/xfs/xfs_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,37 +230,6 @@ xfs_error_report(
}
}

STATIC void
xfs_hex_dump(void *p, int length)
{
__uint8_t *uip = (__uint8_t*)p;
int i;
char sbuf[128], *s;

s = sbuf;
*s = '\0';
for (i=0; i<length; i++, uip++) {
if ((i % 16) == 0) {
if (*s != '\0')
cmn_err(CE_ALERT, "%s\n", sbuf);
s = sbuf;
sprintf(s, "0x%x: ", i);
while( *s != '\0')
s++;
}
sprintf(s, "%02x ", *uip);

/*
* the kernel sprintf is a void; user sprintf returns
* the sprintf'ed string's length. Find the new end-
* of-string
*/
while( *s != '\0')
s++;
}
cmn_err(CE_ALERT, "%s\n", sbuf);
}

void
xfs_corruption_error(
char *tag,
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/xfs/xfs_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ extern void xfs_cmn_err(int panic_tag, int level, struct xfs_mount *mp,
/* PRINTFLIKE3 */
extern void xfs_fs_cmn_err(int level, struct xfs_mount *mp, char *fmt, ...);

extern void xfs_hex_dump(void *p, int length);

#define xfs_fs_repair_cmn_err(level, mp, fmt, args...) \
xfs_fs_cmn_err(level, mp, fmt " Unmount and run xfs_repair.", ## args)

Expand Down

0 comments on commit 413eb82

Please sign in to comment.