mtd/fs/jffs3 summary.c,3.1,3.2
Artem Bityuckiy
dedekind at infradead.org
Tue Dec 21 11:07:54 EST 2004
Update of /home/cvs/mtd/fs/jffs3
In directory phoenix.infradead.org:/tmp/cvs-serv24889
Modified Files:
summary.c
Log Message:
Fix messaging: 1. No func names and prefixes - they are supposed to be
added by output macros. 2. Use ERROR_MSG on critical error. Use
WARNING_MSG on failures which do not make JFFS3 unworkable anymore.
Index: summary.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/summary.c,v
retrieving revision 3.1
retrieving revision 3.2
diff -u -r3.1 -r3.2
--- summary.c 21 Dec 2004 15:18:51 -0000 3.1
+++ summary.c 21 Dec 2004 16:07:52 -0000 3.2
@@ -26,7 +26,7 @@
{
c->summary_buf = (jint32_t *) vmalloc(c->sector_size);
if (!c->summary_buf) {
- WARNING_MSG("JFFS3: can't allocate memory to dump summary information!\n");
+ WARNING_MSG("can't allocate memory to dump summary information!\n");
return 1;
}
return 0;
@@ -85,7 +85,7 @@
jeb->sum_collected->sum_num++;
break;
default:
- WARNING_MSG( "__jffs3_add_sum_mem(): UNKNOWN node type %d\n", je16_to_cpu(item->u.nodetype));
+ WARNING_MSG( "UNKNOWN node type %d\n", je16_to_cpu(item->u.nodetype));
return 1;
}
return 0;
@@ -243,23 +243,23 @@
}
case JFFS3_NODETYPE_PADDING : {
- DBG_SUMMARY(1,"jffs3_sum_add_kvec(): Node PADDING\n");
+ DBG_SUMMARY(1,"Node PADDING\n");
jeb->sum_collected->sum_padded += je32_to_cpu(node->u.totlen);
break;
}
case JFFS3_NODETYPE_CLEANMARKER : {
- DBG_SUMMARY(1,"jffs3_sum_add_kvec(): Node CLEANMARKER\n");
+ DBG_SUMMARY(1,"Node CLEANMARKER\n");
break;
}
case JFFS3_NODETYPE_SUMMARY : {
- DBG_SUMMARY(1,"jffs3_sum_add_kvec(): Node SUMMARY\n");
+ DBG_SUMMARY(1,"Node SUMMARY\n");
break;
}
default : {
- WARNING_MSG("jffs3_sum_add_kvec(): Node not supported\n");
+ ERROR_MSG("Node not supported\n");
BUG();
break;
}
@@ -289,7 +289,7 @@
sumsize = c->sector_size - ofs;
ofs += jeb->offset;
- DBG_SUMMARY(1,"JFFS3: summary found for 0x%08x at 0x%08x (0x%x bytes)\n", jeb->offset, ofs, sumsize);
+ DBG_SUMMARY(1,"Summary found for 0x%08x at 0x%08x (0x%x bytes)\n", jeb->offset, ofs, sumsize);
summary = (struct jffs3_summary_node *) kmalloc(sumsize, GFP_KERNEL);
@@ -311,26 +311,26 @@
crc = crc32(0, &crcnode, sizeof(crcnode)-4);
if (je32_to_cpu(summary->hdr_crc) != crc) {
- DBG_SUMMARY(1,"jffs3_scan_eraseblock(): Summary node header is corrupt (bad CRC or no summary at all)\n");
+ DBG_SUMMARY(1,"Summary node header is corrupt (bad CRC or no summary at all)\n");
bad_sum = 1;
}
if ((!bad_sum) && (je32_to_cpu(summary->totlen) != sumsize)) {
- DBG_SUMMARY(1,"jffs3_scan_eraseblock(): Summary node is corrupt (wrong erasesize?)\n");
+ DBG_SUMMARY(1,"Summary node is corrupt (wrong erasesize?)\n");
bad_sum = 1;
}
crc = crc32(0, summary, sizeof(struct jffs3_summary_node)-8);
if ((!bad_sum) && (je32_to_cpu(summary->node_crc) != crc)) {
- DBG_SUMMARY(1,"jffs3_scan_eraseblock(): Summary node is corrupt (bad CRC)\n");
+ DBG_SUMMARY(1,"Summary node is corrupt (bad CRC)\n");
bad_sum = 1;
}
crc = crc32(0, summary->sum, sumsize - sizeof(struct jffs3_summary_node));
if ((!bad_sum) && (je32_to_cpu(summary->sum_crc) != crc)) {
- DBG_SUMMARY(1,"jffs3_scan_eraseblock(): Summary node data is corrupt (bad CRC)\n");
+ DBG_SUMMARY(1,"Summary node data is corrupt (bad CRC)\n");
bad_sum = 1;
}
@@ -341,7 +341,7 @@
if ( je32_to_cpu(summary->cln_mkr) ) {
- DBG_SUMMARY(1,"Summary : CLEANMARKER node \n");
+ DBG_SUMMARY(1,"CLEANMARKER node \n");
if (je32_to_cpu(summary->cln_mkr) != c->cleanmarker_size) {
DBG_SUMMARY(1,"CLEANMARKER node has totlen 0x%x != normal 0x%x\n",
@@ -378,7 +378,7 @@
for(i = 0; i < je16_to_cpu(summary->sum_num); i++) {
- DBG_SUMMARY(1,"jffs3_scan_eraseblock(): Processing summary information %d\n", i);
+ DBG_SUMMARY(1,"Processing summary information %d\n", i);
uint8_t *temp8ptr = NULL;
switch (je16_to_cpu(sp->nodetype)) {
@@ -388,10 +388,10 @@
spi = (struct jffs3_sum_inode_flash *) sp;
ino = je32_to_cpu(spi->inode);
- DBG_SUMMARY(1,"jffs3_scan_eraseblock(): Inode at 0x%08x\n", jeb->offset + je32_to_cpu(spi->offset));
+ DBG_SUMMARY(1,"Inode at 0x%08x\n", jeb->offset + je32_to_cpu(spi->offset));
raw = jffs3_alloc_raw_node_ref();
if (!raw) {
- NOTICE_MSG("jffs3_scan_eraseblock(): allocation of node reference failed\n");
+ WARNING_MSG("allocation of node reference failed\n");
kfree(summary);
return -ENOMEM;
}
@@ -400,7 +400,7 @@
if (!ic) {
ic = jffs3_scan_make_ino_cache(c, ino);
if (!ic) {
- NOTICE_MSG("jffs3_scan_eraseblock(): scan_make_ino_cache failed\n");
+ WARNING_MSG("scan_make_ino_cache failed\n");
jffs3_free_raw_node_ref(raw);
kfree(summary);
return -ENOMEM;
@@ -445,7 +445,7 @@
raw = jffs3_alloc_raw_node_ref();
if (!raw) {
jffs3_free_full_dirent(fd);
- NOTICE_MSG("jffs3_scan_dirent_node(): allocation of node reference failed\n");
+ WARNING_MSG("allocation of node reference failed\n");
kfree(summary);
return -ENOMEM;
}
@@ -501,7 +501,7 @@
cache_ref = jffs3_alloc_raw_node_ref();
if (!cache_ref) {
- NOTICE_MSG("Failed to allocate node ref for cache\n");
+ WARNING_MSG("Failed to allocate node ref for cache\n");
return -ENOMEM;
}
@@ -566,12 +566,12 @@
struct kvec vecs[2];
jint32_t magic = cpu_to_je32(JFFS3_SUM_MAGIC);
- DBG_SUMMARY(2,"jffs3_sum_write_sumnode()\n");
+ DBG_SUMMARY(2,"entering\n");
jeb = c->nextblock;
if (!jeb->sum_collected->sum_num || !jeb->sum_collected->sum_list) {
- WARNING_MSG("JFFS3: jffs3_sum_write_sumnode(): empty summary info!!!\n");
+ ERROR_MSG("empty summary info!!!\n");
BUG();
}
@@ -596,7 +596,7 @@
jeb->sum_collected->sum_num = 0;
jeb->sum_collected->sum_size = JFFS3_SUMMARY_NOSUM_SIZE; // don't try to write out summary for this node
- WARNING_MSG("JFFS3: not enough space for summary, padsize = %d\n",padsize);
+ WARNING_MSG("not enough space for summary, padsize = %d\n",padsize);
return 0;
}
@@ -663,7 +663,7 @@
}
default : {
- WARNING_MSG("Unknown node in summary information!!!\n");
+ ERROR_MSG("Unknown node in summary information!!!\n");
BUG();
}
}
@@ -692,7 +692,7 @@
vecs[1].iov_base = c->summary_buf;
vecs[1].iov_len = datasize;
- DBG_SUMMARY(1,"JFFS3: writing out data to flash to pos : 0x%08x\n",jeb->offset + c->sector_size - jeb->free_size);
+ DBG_SUMMARY(1,"writing out data to flash to pos : 0x%08x\n",jeb->offset + c->sector_size - jeb->free_size);
spin_unlock(&c->erase_completion_lock);
ret = jffs3_flash_writev(c, vecs, 2, jeb->offset + c->sector_size - jeb->free_size, &retlen, 0);
@@ -700,7 +700,7 @@
if (ret || (retlen != infosize)) {
- WARNING_MSG("JFFS3: write of %zd bytes at 0x%08x failed. returned %d, retlen %zd\n",
+ WARNING_MSG("write of %zd bytes at 0x%08x failed. returned %d, retlen %zd\n",
infosize, jeb->offset + c->sector_size - jeb->free_size, ret, retlen);
jeb->sum_collected->sum_size = JFFS3_SUMMARY_NOSUM_SIZE;
@@ -716,5 +716,5 @@
WASTED_SPACE(infosize);
- return 0;
+ return 0;
}
More information about the linux-mtd-cvs
mailing list