mtd/fs/jffs3 scan.c,3.17,3.18 summary.c,3.10,3.11
havasi at infradead.org
havasi at infradead.org
Mon May 9 04:16:12 EDT 2005
Update of /home/cvs/mtd/fs/jffs3
In directory phoenix.infradead.org:/tmp/cvs-serv28074/jffs3
Modified Files:
scan.c summary.c
Log Message:
Summary fixes for JFFS3
- remove NO_CRC option (it could cause incorrect behaviour)
- fix a bug (locking) by Artem
Index: scan.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/scan.c,v
retrieving revision 3.17
retrieving revision 3.18
diff -u -r3.17 -r3.18
--- scan.c 14 Apr 2005 09:12:09 -0000 3.17
+++ scan.c 9 May 2005 08:16:09 -0000 3.18
@@ -782,9 +782,7 @@
return -ENOMEM;
}
}
-#ifdef CONFIG_JFFS3_SUMMARY_NOCRCCHECK
- ic->state = INO_STATE_UNCHECKED;
-#endif
+
/* Wheee. It worked */
raw->flash_offset = ofs | REF_UNCHECKED;
@@ -868,19 +866,12 @@
return -ENOMEM;
}
- ic = jffs3_get_ino_cache(c, je32_to_cpu(rd->pino));
+ ic = jffs3_scan_make_ino_cache(c, je32_to_cpu(rd->pino));
if (!ic) {
- ic = jffs3_scan_make_ino_cache(c, je32_to_cpu(rd->pino));
- if (!ic) {
- jffs3_free_full_dirent(fd);
- jffs3_free_raw_node_ref(raw);
- return -ENOMEM;
- }
- #ifdef CONFIG_JFFS3_SUMMARY_NOCRCCHECK
- ic->state = INO_STATE_CHECKEDABSENT;
- #endif
+ jffs3_free_full_dirent(fd);
+ jffs3_free_raw_node_ref(raw);
+ return -ENOMEM;
}
-
#ifdef TMP_TOTLEN
raw->__totlen = PAD(je32_to_cpu(rd->totlen));
Index: summary.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/summary.c,v
retrieving revision 3.10
retrieving revision 3.11
diff -u -r3.10 -r3.11
--- summary.c 15 Feb 2005 10:23:16 -0000 3.10
+++ summary.c 9 May 2005 08:16:09 -0000 3.11
@@ -395,8 +395,8 @@
for(i = 0; i < je16_to_cpu(summary->sum_num); i++) {
- DBG_SUMMARY(1,"Processing summary information %d\n", i);
uint8_t *temp8ptr = NULL;
+ DBG_SUMMARY(1,"Processing summary information %d\n", i);
switch (je16_to_cpu(sp->nodetype)) {
@@ -413,26 +413,15 @@
return -ENOMEM;
}
- ic = jffs3_get_ino_cache(c, ino);
+ ic = jffs3_scan_make_ino_cache(c, ino);
if (!ic) {
- ic = jffs3_scan_make_ino_cache(c, ino);
- if (!ic) {
- WARNING_MSG("scan_make_ino_cache failed\n");
- jffs3_free_raw_node_ref(raw);
- kfree(summary);
- return -ENOMEM;
- }
- #ifdef CONFIG_JFFS3_SUMMARY_NOCRCCHECK
- ic->state = INO_STATE_CHECKEDABSENT;
- #endif
+ WARNING_MSG("scan_make_ino_cache failed\n");
+ jffs3_free_raw_node_ref(raw);
+ kfree(summary);
+ return -ENOMEM;
}
- raw->flash_offset = (jeb->offset + je32_to_cpu(spi->offset)) |
- #ifdef CONFIG_JFFS3_SUMMARY_NOCRCCHECK
- REF_NORMAL;
- #else
- REF_UNCHECKED;
- #endif
+ raw->flash_offset = (jeb->offset + je32_to_cpu(spi->offset)) | REF_UNCHECKED;
#ifdef TMP_TOTLEN
raw->__totlen = PAD(je32_to_cpu(spi->totlen));
@@ -448,11 +437,8 @@
jeb->last_node = raw;
*pseudo_random += je32_to_cpu(spi->version);
- #ifdef CONFIG_JFFS3_SUMMARY_NOCRCCHECK
- USED_SPACE(PAD(je32_to_cpu(spi->totlen)));
- #else
+
UNCHECKED_SPACE(PAD(je32_to_cpu(spi->totlen)));
- #endif
temp8ptr = (uint8_t *) sp;
temp8ptr += JFFS3_SUMMARY_INODE_SIZE;
@@ -482,18 +468,12 @@
return -ENOMEM;
}
- ic = jffs3_get_ino_cache(c, je32_to_cpu(spd->pino));
+ ic = jffs3_scan_make_ino_cache(c, je32_to_cpu(spd->pino));
if (!ic) {
- ic = jffs3_scan_make_ino_cache(c, je32_to_cpu(spd->pino));
- if (!ic) {
- jffs3_free_full_dirent(fd);
- jffs3_free_raw_node_ref(raw);
- kfree(summary);
- return -ENOMEM;
- }
- #ifdef CONFIG_JFFS3_SUMMARY_NOCRCCHECK
- ic->state = INO_STATE_CHECKEDABSENT;
- #endif
+ jffs3_free_full_dirent(fd);
+ jffs3_free_raw_node_ref(raw);
+ kfree(summary);
+ return -ENOMEM;
}
#ifdef TMP_TOTLEN
@@ -754,7 +734,9 @@
return 0;
}
+ spin_unlock(&c->erase_completion_lock);
summary_ref = jffs3_alloc_raw_node_ref();
+ spin_lock(&c->erase_completion_lock);
if (!summary_ref) {
printk(KERN_NOTICE "Failed to allocate node ref for summary\n");
More information about the linux-mtd-cvs
mailing list