mtd/fs/jffs3 scan.c,3.9,3.10 summary.c,3.5,3.6 writev.c,3.2,3.3
havasi at infradead.org
havasi at infradead.org
Fri Jan 7 03:54:04 EST 2005
Update of /home/cvs/mtd/fs/jffs3
In directory phoenix.infradead.org:/tmp/cvs-serv11589/fs/jffs3
Modified Files:
scan.c summary.c writev.c
Log Message:
Summary fixes:
- NOR support fix
- dirent handle fix (GC related)
- free collected summaries for already closed erase blocks
Index: scan.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/scan.c,v
retrieving revision 3.9
retrieving revision 3.10
diff -u -r3.9 -r3.10
--- scan.c 5 Jan 2005 16:19:00 -0000 3.9
+++ scan.c 7 Jan 2005 08:54:00 -0000 3.10
@@ -666,6 +666,20 @@
}
}
+#ifdef CONFIG_JFFS3_SUMMARY
+ if (jeb->sum_collected) {
+ if (jeb->sum_collected->sum_size + JFFS3_SUMMARY_FRAME_SIZE > jeb->free_size) {
+ DBG_SUMMARY(1,"There is not enough space for "
+ "summary information, freeing up summary info!\n");
+ jffs3_sum_clean_collected(jeb);
+ }
+
+ }
+ else {
+ DBG_SUMMARY(1,"Empty summary info found\n");
+ }
+#endif
+
DBG_SCAN(1, "Block at %#08x: free %#08x, dirty %#08x, unchecked %#08x, "
"used %#08x\n", jeb->offset, jeb->free_size, jeb->dirty_size,
jeb->unchecked_size, jeb->used_size);
Index: summary.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/summary.c,v
retrieving revision 3.5
retrieving revision 3.6
diff -u -r3.5 -r3.6
--- summary.c 5 Jan 2005 16:19:00 -0000 3.5
+++ summary.c 7 Jan 2005 08:54:00 -0000 3.6
@@ -236,9 +236,22 @@
temp->nsize = node->d.nsize;
temp->type = node->d.type;
temp->next = NULL;
-
- memcpy(temp->name,invecs[1].iov_base,node->d.nsize);
-
+
+ switch (count) {
+
+ case 1 :
+ memcpy(temp->name,node->d.name,node->d.nsize);
+ break;
+
+ case 2 :
+ memcpy(temp->name,invecs[1].iov_base,node->d.nsize);
+ break;
+
+ default :
+ WARNING_MSG("bad count value\n");
+ break;
+ }
+
return jffs3_sum_add_mem(jeb, (union jffs3_sum_mem *)temp);
break;
Index: writev.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/writev.c,v
retrieving revision 3.2
retrieving revision 3.3
diff -u -r3.2 -r3.3
--- writev.c 5 Jan 2005 16:19:01 -0000 3.2
+++ writev.c 7 Jan 2005 08:54:00 -0000 3.3
@@ -15,6 +15,7 @@
#include <linux/kernel.h>
#include <linux/mtd/mtd.h>
#include "nodelist.h"
+#include "summary.h"
/* This ought to be in core MTD code. All registered MTD devices
without writev should have this put in place. Bug the MTD
@@ -45,7 +46,14 @@
{
if (c->mtd->writev)
return c->mtd->writev(c->mtd, vecs, count, to, retlen);
- else
+ else {
+
+#ifdef CONFIG_JFFS3_SUMMARY
+ DBG_SUMMARY(1,"Without NAND support\n");
+ if (jffs3_sum_add_kvec(c,vecs,count,(uint32_t) to)) {
+ ERROR_MSG("MEMORY ALLOCATION ERROR!\n");
+ }
+#endif
return mtd_fake_writev(c->mtd, vecs, count, to, retlen);
+ }
}
-
More information about the linux-mtd-cvs
mailing list