Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 209e101b authored by Dave Kleikamp's avatar Dave Kleikamp
Browse files

JFS: use print_hex_dump() rather than private dump_mem() function

parent f720e3ba
Loading
Loading
Loading
Loading
+0 −28
Original line number Original line Diff line number Diff line
@@ -26,34 +26,6 @@
#include "jfs_filsys.h"
#include "jfs_filsys.h"
#include "jfs_debug.h"
#include "jfs_debug.h"


#ifdef CONFIG_JFS_DEBUG
void dump_mem(char *label, void *data, int length)
{
	int i, j;
	int *intptr = data;
	char *charptr = data;
	char buf[10], line[80];

	printk("%s: dump of %d bytes of data at 0x%p\n\n", label, length,
	       data);
	for (i = 0; i < length; i += 16) {
		line[0] = 0;
		for (j = 0; (j < 4) && (i + j * 4 < length); j++) {
			sprintf(buf, " %08x", intptr[i / 4 + j]);
			strcat(line, buf);
		}
		buf[0] = ' ';
		buf[2] = 0;
		for (j = 0; (j < 16) && (i + j < length); j++) {
			buf[1] =
			    isprint(charptr[i + j]) ? charptr[i + j] : '.';
			strcat(line, buf);
		}
		printk("%s\n", line);
	}
}
#endif

#ifdef PROC_FS_JFS /* see jfs_debug.h */
#ifdef PROC_FS_JFS /* see jfs_debug.h */


static struct proc_dir_entry *base;
static struct proc_dir_entry *base;
+0 −2
Original line number Original line Diff line number Diff line
@@ -62,7 +62,6 @@ extern void jfs_proc_clean(void);


extern int jfsloglevel;
extern int jfsloglevel;


extern void dump_mem(char *label, void *data, int length);
extern int jfs_txanchor_read(char *, char **, off_t, int, int *, void *);
extern int jfs_txanchor_read(char *, char **, off_t, int, int *, void *);


/* information message: e.g., configuration, major event */
/* information message: e.g., configuration, major event */
@@ -94,7 +93,6 @@ extern int jfs_txanchor_read(char *, char **, off_t, int, int *, void *);
 *	---------
 *	---------
 */
 */
#else				/* CONFIG_JFS_DEBUG */
#else				/* CONFIG_JFS_DEBUG */
#define dump_mem(label,data,length) do {} while (0)
#define ASSERT(p) do {} while (0)
#define ASSERT(p) do {} while (0)
#define jfs_info(fmt, arg...) do {} while (0)
#define jfs_info(fmt, arg...) do {} while (0)
#define jfs_debug(fmt, arg...) do {} while (0)
#define jfs_debug(fmt, arg...) do {} while (0)
+2 −1
Original line number Original line Diff line number Diff line
@@ -890,7 +890,8 @@ int diFree(struct inode *ip)
	 * the map.
	 * the map.
	 */
	 */
	if (iagno >= imap->im_nextiag) {
	if (iagno >= imap->im_nextiag) {
		dump_mem("imap", imap, 32);
		printk(KERN_ERR "Dump of imap:\n");
		print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS, imap, 32);
		jfs_error(ip->i_sb,
		jfs_error(ip->i_sb,
			  "diFree: inum = %d, iagno = %d, nextiag = %d",
			  "diFree: inum = %d, iagno = %d, nextiag = %d",
			  (uint) inum, iagno, imap->im_nextiag);
			  (uint) inum, iagno, imap->im_nextiag);
+12 −6
Original line number Original line Diff line number Diff line
@@ -1622,16 +1622,22 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
	if (!list_empty(&log->synclist)) {
	if (!list_empty(&log->synclist)) {
		struct logsyncblk *lp;
		struct logsyncblk *lp;


		printk(KERN_ERR "jfs_flush_journal: synclist not empty\n");
		list_for_each_entry(lp, &log->synclist, synclist) {
		list_for_each_entry(lp, &log->synclist, synclist) {
			if (lp->xflag & COMMIT_PAGE) {
			if (lp->xflag & COMMIT_PAGE) {
				struct metapage *mp = (struct metapage *)lp;
				struct metapage *mp = (struct metapage *)lp;
				dump_mem("orphan metapage", lp,
				printk (KERN_ERR "orphan metapage:\n");
					 sizeof(struct metapage));
				print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS,
				dump_mem("page", mp->page, sizeof(struct page));
					       lp, sizeof(struct metapage));
				printk (KERN_ERR "page:\n");
				print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS,
					       mp->page, sizeof(struct page));
			}
			else {
				printk (KERN_ERR "orphan tblock:\n");
				print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS,
					       lp, sizeof(struct tblock));
			}
			}
			else
				dump_mem("orphan tblock", lp,
					 sizeof(struct tblock));
		}
		}
	}
	}
#endif
#endif
+2 −1
Original line number Original line Diff line number Diff line
@@ -472,7 +472,8 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
	printk(KERN_ERR "JFS: bio_add_page failed unexpectedly\n");
	printk(KERN_ERR "JFS: bio_add_page failed unexpectedly\n");
	goto skip;
	goto skip;
dump_bio:
dump_bio:
	dump_mem("bio", bio, sizeof(*bio));
	printk(KERN_ERR "JFS: dump of bio:\n");
	print_hex_dump(KERN_ERR, DUMP_PREFIX_ADDRESS, bio, sizeof(*bio));
skip:
skip:
	bio_put(bio);
	bio_put(bio);
	unlock_page(page);
	unlock_page(page);
Loading