diff options
author | Dave Kleikamp <shaggy@linux.vnet.ibm.com> | 2007-06-06 17:30:17 -0400 |
---|---|---|
committer | Dave Kleikamp <shaggy@linux.vnet.ibm.com> | 2007-06-06 17:30:17 -0400 |
commit | 209e101bf408a50acc426e32c8252daefacde5b0 (patch) | |
tree | 9627c9273e35f142e58059aa85b77c0367c45315 /fs | |
parent | f720e3ba558680cc7dd3995d005bdc8ee2ef46af (diff) |
JFS: use print_hex_dump() rather than private dump_mem() function
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/jfs/jfs_debug.c | 28 | ||||
-rw-r--r-- | fs/jfs/jfs_debug.h | 2 | ||||
-rw-r--r-- | fs/jfs/jfs_imap.c | 3 | ||||
-rw-r--r-- | fs/jfs/jfs_logmgr.c | 18 | ||||
-rw-r--r-- | fs/jfs/jfs_metapage.c | 3 | ||||
-rw-r--r-- | fs/jfs/jfs_txnmgr.c | 17 | ||||
-rw-r--r-- | fs/jfs/xattr.c | 3 |
7 files changed, 29 insertions, 45 deletions
diff --git a/fs/jfs/jfs_debug.c b/fs/jfs/jfs_debug.c index 9c5d59632aac..887f5759e536 100644 --- a/fs/jfs/jfs_debug.c +++ b/fs/jfs/jfs_debug.c | |||
@@ -26,34 +26,6 @@ | |||
26 | #include "jfs_filsys.h" | 26 | #include "jfs_filsys.h" |
27 | #include "jfs_debug.h" | 27 | #include "jfs_debug.h" |
28 | 28 | ||
29 | #ifdef CONFIG_JFS_DEBUG | ||
30 | void dump_mem(char *label, void *data, int length) | ||
31 | { | ||
32 | int i, j; | ||
33 | int *intptr = data; | ||
34 | char *charptr = data; | ||
35 | char buf[10], line[80]; | ||
36 | |||
37 | printk("%s: dump of %d bytes of data at 0x%p\n\n", label, length, | ||
38 | data); | ||
39 | for (i = 0; i < length; i += 16) { | ||
40 | line[0] = 0; | ||
41 | for (j = 0; (j < 4) && (i + j * 4 < length); j++) { | ||
42 | sprintf(buf, " %08x", intptr[i / 4 + j]); | ||
43 | strcat(line, buf); | ||
44 | } | ||
45 | buf[0] = ' '; | ||
46 | buf[2] = 0; | ||
47 | for (j = 0; (j < 16) && (i + j < length); j++) { | ||
48 | buf[1] = | ||
49 | isprint(charptr[i + j]) ? charptr[i + j] : '.'; | ||
50 | strcat(line, buf); | ||
51 | } | ||
52 | printk("%s\n", line); | ||
53 | } | ||
54 | } | ||
55 | #endif | ||
56 | |||
57 | #ifdef PROC_FS_JFS /* see jfs_debug.h */ | 29 | #ifdef PROC_FS_JFS /* see jfs_debug.h */ |
58 | 30 | ||
59 | static struct proc_dir_entry *base; | 31 | static struct proc_dir_entry *base; |
diff --git a/fs/jfs/jfs_debug.h b/fs/jfs/jfs_debug.h index 7378798f0b21..044c1e654cc0 100644 --- a/fs/jfs/jfs_debug.h +++ b/fs/jfs/jfs_debug.h | |||
@@ -62,7 +62,6 @@ extern void jfs_proc_clean(void); | |||
62 | 62 | ||
63 | extern int jfsloglevel; | 63 | extern int jfsloglevel; |
64 | 64 | ||
65 | extern void dump_mem(char *label, void *data, int length); | ||
66 | extern int jfs_txanchor_read(char *, char **, off_t, int, int *, void *); | 65 | extern int jfs_txanchor_read(char *, char **, off_t, int, int *, void *); |
67 | 66 | ||
68 | /* information message: e.g., configuration, major event */ | 67 | /* information message: e.g., configuration, major event */ |
@@ -94,7 +93,6 @@ extern int jfs_txanchor_read(char *, char **, off_t, int, int *, void *); | |||
94 | * --------- | 93 | * --------- |
95 | */ | 94 | */ |
96 | #else /* CONFIG_JFS_DEBUG */ | 95 | #else /* CONFIG_JFS_DEBUG */ |
97 | #define dump_mem(label,data,length) do {} while (0) | ||
98 | #define ASSERT(p) do {} while (0) | 96 | #define ASSERT(p) do {} while (0) |
99 | #define jfs_info(fmt, arg...) do {} while (0) | 97 | #define jfs_info(fmt, arg...) do {} while (0) |
100 | #define jfs_debug(fmt, arg...) do {} while (0) | 98 | #define jfs_debug(fmt, arg...) do {} while (0) |
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index f5c5227b0d1f..19da0e17e4de 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c | |||
@@ -890,7 +890,8 @@ int diFree(struct inode *ip) | |||
890 | * the map. | 890 | * the map. |
891 | */ | 891 | */ |
892 | if (iagno >= imap->im_nextiag) { | 892 | if (iagno >= imap->im_nextiag) { |
893 | dump_mem("imap", imap, 32); | 893 | printk(KERN_ERR "Dump of imap:\n"); |
894 | print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS, imap, 32); | ||
894 | jfs_error(ip->i_sb, | 895 | jfs_error(ip->i_sb, |
895 | "diFree: inum = %d, iagno = %d, nextiag = %d", | 896 | "diFree: inum = %d, iagno = %d, nextiag = %d", |
896 | (uint) inum, iagno, imap->im_nextiag); | 897 | (uint) inum, iagno, imap->im_nextiag); |
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 88eae45a4644..2917ede90d67 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c | |||
@@ -1622,16 +1622,22 @@ void jfs_flush_journal(struct jfs_log *log, int wait) | |||
1622 | if (!list_empty(&log->synclist)) { | 1622 | if (!list_empty(&log->synclist)) { |
1623 | struct logsyncblk *lp; | 1623 | struct logsyncblk *lp; |
1624 | 1624 | ||
1625 | printk(KERN_ERR "jfs_flush_journal: synclist not empty\n"); | ||
1625 | list_for_each_entry(lp, &log->synclist, synclist) { | 1626 | list_for_each_entry(lp, &log->synclist, synclist) { |
1626 | if (lp->xflag & COMMIT_PAGE) { | 1627 | if (lp->xflag & COMMIT_PAGE) { |
1627 | struct metapage *mp = (struct metapage *)lp; | 1628 | struct metapage *mp = (struct metapage *)lp; |
1628 | dump_mem("orphan metapage", lp, | 1629 | printk (KERN_ERR "orphan metapage:\n"); |
1629 | sizeof(struct metapage)); | 1630 | print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS, |
1630 | dump_mem("page", mp->page, sizeof(struct page)); | 1631 | lp, sizeof(struct metapage)); |
1632 | printk (KERN_ERR "page:\n"); | ||
1633 | print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS, | ||
1634 | mp->page, sizeof(struct page)); | ||
1635 | } | ||
1636 | else { | ||
1637 | printk (KERN_ERR "orphan tblock:\n"); | ||
1638 | print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS, | ||
1639 | lp, sizeof(struct tblock)); | ||
1631 | } | 1640 | } |
1632 | else | ||
1633 | dump_mem("orphan tblock", lp, | ||
1634 | sizeof(struct tblock)); | ||
1635 | } | 1641 | } |
1636 | } | 1642 | } |
1637 | #endif | 1643 | #endif |
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c index 43d4f69afbec..1c4fced1e6d8 100644 --- a/fs/jfs/jfs_metapage.c +++ b/fs/jfs/jfs_metapage.c | |||
@@ -472,7 +472,8 @@ add_failed: | |||
472 | printk(KERN_ERR "JFS: bio_add_page failed unexpectedly\n"); | 472 | printk(KERN_ERR "JFS: bio_add_page failed unexpectedly\n"); |
473 | goto skip; | 473 | goto skip; |
474 | dump_bio: | 474 | dump_bio: |
475 | dump_mem("bio", bio, sizeof(*bio)); | 475 | printk(KERN_ERR "JFS: dump of bio:\n"); |
476 | print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS, bio, sizeof(*bio)); | ||
476 | skip: | 477 | skip: |
477 | bio_put(bio); | 478 | bio_put(bio); |
478 | unlock_page(page); | 479 | unlock_page(page); |
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c index f2dc4b986392..d6f23f90ad36 100644 --- a/fs/jfs/jfs_txnmgr.c +++ b/fs/jfs/jfs_txnmgr.c | |||
@@ -829,12 +829,17 @@ struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp, | |||
829 | /* Only locks on ipimap or ipaimap should reach here */ | 829 | /* Only locks on ipimap or ipaimap should reach here */ |
830 | /* assert(jfs_ip->fileset == AGGREGATE_I); */ | 830 | /* assert(jfs_ip->fileset == AGGREGATE_I); */ |
831 | if (jfs_ip->fileset != AGGREGATE_I) { | 831 | if (jfs_ip->fileset != AGGREGATE_I) { |
832 | jfs_err("txLock: trying to lock locked page!"); | 832 | printk(KERN_ERR "txLock: trying to lock locked page!"); |
833 | dump_mem("ip", ip, sizeof(struct inode)); | 833 | printk(KERN_ERR "ip:\n"); |
834 | dump_mem("mp", mp, sizeof(struct metapage)); | 834 | print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS, ip, sizeof(*ip)); |
835 | dump_mem("Locker's tblk", tid_to_tblock(tid), | 835 | printk(KERN_ERR "mp:\n"); |
836 | sizeof(struct tblock)); | 836 | print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS, mp, sizeof(*mp)); |
837 | dump_mem("Tlock", tlck, sizeof(struct tlock)); | 837 | printk(KERN_ERR "Locker's tblk:\n"); |
838 | print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS, | ||
839 | tid_to_tblock(tid), sizeof(struct tblock)); | ||
840 | printk(KERN_ERR "Tlock:\n"); | ||
841 | print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS, tlck, | ||
842 | sizeof(*tlck)); | ||
838 | BUG(); | 843 | BUG(); |
839 | } | 844 | } |
840 | INCREMENT(stattx.waitlock); /* statistics */ | 845 | INCREMENT(stattx.waitlock); /* statistics */ |
diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c index 5c0f2de01316..2dcb13275429 100644 --- a/fs/jfs/xattr.c +++ b/fs/jfs/xattr.c | |||
@@ -590,7 +590,8 @@ static int ea_get(struct inode *inode, struct ea_buffer *ea_buf, int min_size) | |||
590 | size_check: | 590 | size_check: |
591 | if (EALIST_SIZE(ea_buf->xattr) != ea_size) { | 591 | if (EALIST_SIZE(ea_buf->xattr) != ea_size) { |
592 | printk(KERN_ERR "ea_get: invalid extended attribute\n"); | 592 | printk(KERN_ERR "ea_get: invalid extended attribute\n"); |
593 | dump_mem("xattr", ea_buf->xattr, ea_size); | 593 | print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS, ea_buf->xattr, |
594 | ea_size); | ||
594 | ea_release(inode, ea_buf); | 595 | ea_release(inode, ea_buf); |
595 | rc = -EIO; | 596 | rc = -EIO; |
596 | goto clean_up; | 597 | goto clean_up; |