mtd/fs/jffs3 nodemgmt.c, 3.15, 3.16 scan.c, 3.16, 3.17 summary.h, 3.3, 3.4

havasi at infradead.org havasi at infradead.org
Thu Apr 14 05:12:12 EDT 2005


Update of /home/cvs/mtd/fs/jffs3
In directory phoenix.infradead.org:/tmp/cvs-serv3516

Modified Files:
	nodemgmt.c scan.c summary.h 
Log Message:
Summary PAD fix.



Index: nodemgmt.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/nodemgmt.c,v
retrieving revision 3.15
retrieving revision 3.16
diff -u -r3.15 -r3.16
--- nodemgmt.c	25 Jan 2005 20:11:12 -0000	3.15
+++ nodemgmt.c	14 Apr 2005 09:12:09 -0000	3.16
@@ -184,13 +184,13 @@
 
 		if (jeb) {
 		    if ((ret=jffs3_sum_care_sum_collected(jeb))) return ret;
-		    nofree_size = sumsize + jeb->sum_collected->sum_size + JFFS3_SUMMARY_FRAME_SIZE;
+		    nofree_size = PAD(sumsize + jeb->sum_collected->sum_size + JFFS3_SUMMARY_FRAME_SIZE);
 		}
 
 		DBG_SUMMARY(1,"minsize %d , jeb->free(%d) , sum_collected->size(%d) , sumsize(%d)\n",
 		minsize,jeb->free_size,jeb->sum_collected->sum_size,sumsize);
 
-		if (jeb && (minsize + jeb->sum_collected->sum_size + sumsize + JFFS3_SUMMARY_FRAME_SIZE > jeb->free_size)) {
+		if (jeb && (PAD(minsize) + PAD(jeb->sum_collected->sum_size + sumsize + JFFS3_SUMMARY_FRAME_SIZE) > jeb->free_size)) {
 			DBG_SUMMARY(1,"generating summary for 0x%08x.\n", jeb->offset);
 			if (jeb->sum_collected->sum_size == JFFS3_SUMMARY_NOSUM_SIZE) {
 				sumsize = JFFS3_SUMMARY_NOSUM_SIZE;

Index: scan.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/scan.c,v
retrieving revision 3.16
retrieving revision 3.17
diff -u -r3.16 -r3.17
--- scan.c	25 Feb 2005 10:36:34 -0000	3.16
+++ scan.c	14 Apr 2005 09:12:09 -0000	3.17
@@ -668,7 +668,7 @@
 
 #ifdef CONFIG_JFFS3_SUMMARY
 	if (jeb->sum_collected) {
-		if (jeb->sum_collected->sum_size + JFFS3_SUMMARY_FRAME_SIZE > jeb->free_size) {
+		if (PAD(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);

Index: summary.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/summary.h,v
retrieving revision 3.3
retrieving revision 3.4
diff -u -r3.3 -r3.4
--- summary.h	5 Jan 2005 16:19:00 -0000	3.3
+++ summary.h	14 Apr 2005 09:12:09 -0000	3.4
@@ -106,7 +106,7 @@
 	jint32_t magic;
 };
 
-#define JFFS3_SUMMARY_FRAME_SIZE (sizeof(struct jffs3_summary_node)+sizeof(struct jffs3_sum_marker)+3)
+#define JFFS3_SUMMARY_FRAME_SIZE (sizeof(struct jffs3_summary_node) + sizeof(struct jffs3_sum_marker))
 
 #if !(defined(SUM_TOOL) || defined(JFFS2DUMP))
 





More information about the linux-mtd-cvs mailing list