mtd/util jffs2dump.c,1.9,1.10 summary.h,1.4,1.5 sumtool.c,1.6,1.7

havasi at infradead.org havasi at infradead.org
Mon Sep 26 07:49:42 EDT 2005


Update of /home/cvs/mtd/util
In directory phoenix.infradead.org:/tmp/cvs-serv8427

Modified Files:
	jffs2dump.c summary.h sumtool.c 
Log Message:
[JFFS2] rename jffs2_summary_node to jffs2_raw_summary



Index: jffs2dump.c
===================================================================
RCS file: /home/cvs/mtd/util/jffs2dump.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- jffs2dump.c	7 Sep 2005 08:34:57 -0000	1.9
+++ jffs2dump.c	26 Sep 2005 11:49:39 -0000	1.10
@@ -298,7 +298,7 @@
 					je32_to_cpu (node->s.sum_num),
 					je32_to_cpu (node->s.cln_mkr));
 
-			crc = crc32 (0, node, sizeof (struct jffs2_summary_node) - 8);
+			crc = crc32 (0, node, sizeof (struct jffs2_raw_summary) - 8);
 			if (crc != je32_to_cpu (node->s.node_crc)) {
 				printf ("Wrong node_crc at  0x%08x, 0x%08x instead of 0x%08x\n", p - data, je32_to_cpu (node->s.node_crc), crc);
 				p += PAD(je32_to_cpu (node->s.totlen));
@@ -306,7 +306,7 @@
 				continue;
 			}
 
-			crc = crc32(0, p + sizeof (struct jffs2_summary_node),  je32_to_cpu (node->s.totlen) - sizeof(struct jffs2_summary_node));
+			crc = crc32(0, p + sizeof (struct jffs2_raw_summary),  je32_to_cpu (node->s.totlen) - sizeof(struct jffs2_raw_summary));
 			if (crc != je32_to_cpu(node->s.sum_crc)) {
 				printf ("Wrong data_crc at  0x%08x, 0x%08x instead of 0x%08x\n", p - data, je32_to_cpu (node->s.sum_crc), crc);
 				p += PAD(je32_to_cpu (node->s.totlen));
@@ -316,7 +316,7 @@
 
 			if (verbose) {
 				void *sp;
-				sp = (p + sizeof(struct jffs2_summary_node));
+				sp = (p + sizeof(struct jffs2_raw_summary));
 
 				for(i=0; i<je32_to_cpu(node->s.sum_num); i++) {
 
@@ -550,13 +550,13 @@
 			newnode.s.cln_mkr = cnv_e32 (node->s.cln_mkr);
 			newnode.s.padded = cnv_e32 (node->s.padded);
 
-			newnode.s.node_crc = cpu_to_e32 (crc32 (0, &newnode, sizeof (struct jffs2_summary_node) - 8));
+			newnode.s.node_crc = cpu_to_e32 (crc32 (0, &newnode, sizeof (struct jffs2_raw_summary) - 8));
 
 			// summary header
-			p += sizeof (struct jffs2_summary_node);
+			p += sizeof (struct jffs2_raw_summary);
 
 			// summary data
-			sum_len = je32_to_cpu (node->s.totlen) - sizeof (struct jffs2_summary_node) - sizeof (struct jffs2_sum_marker);
+			sum_len = je32_to_cpu (node->s.totlen) - sizeof (struct jffs2_raw_summary) - sizeof (struct jffs2_sum_marker);
 
 			for (i=0; i<je32_to_cpu (node->s.sum_num); i++) {
 				union jffs2_sum_flash *fl_ptr;
@@ -604,11 +604,11 @@
 			p += sizeof (struct jffs2_sum_marker);
 
 			// generate new crc on sum data
-			newnode.s.sum_crc = cpu_to_e32 ( crc32(0, ((char *) node) + sizeof (struct jffs2_summary_node), 
-				je32_to_cpu (node->s.totlen) - sizeof (struct jffs2_summary_node)));
+			newnode.s.sum_crc = cpu_to_e32 ( crc32(0, ((char *) node) + sizeof (struct jffs2_raw_summary), 
+				je32_to_cpu (node->s.totlen) - sizeof (struct jffs2_raw_summary)));
 
 			// write out new node header
-			write(fd, &newnode, sizeof (struct jffs2_summary_node));
+			write(fd, &newnode, sizeof (struct jffs2_raw_summary));
 			// write out new summary data
 			write(fd, &node->s.sum, sum_len + sizeof (struct jffs2_sum_marker));
 

Index: summary.h
===================================================================
RCS file: /home/cvs/mtd/util/summary.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- summary.h	7 Sep 2005 08:34:57 -0000	1.4
+++ summary.h	26 Sep 2005 11:49:39 -0000	1.5
@@ -138,6 +138,6 @@
 	jint32_t magic; 	/* == JFFS2_SUM_MAGIC */
 };
 
-#define JFFS2_SUMMARY_FRAME_SIZE (sizeof(struct jffs2_summary_node) + sizeof(struct jffs2_sum_marker))
+#define JFFS2_SUMMARY_FRAME_SIZE (sizeof(struct jffs2_raw_summary) + sizeof(struct jffs2_sum_marker))
 
 #endif

Index: sumtool.c
===================================================================
RCS file: /home/cvs/mtd/util/sumtool.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- sumtool.c	22 Sep 2005 09:33:22 -0000	1.6
+++ sumtool.c	26 Sep 2005 11:49:39 -0000	1.7
@@ -366,7 +366,7 @@
 void dump_sum_records()
 {
 
-	struct jffs2_summary_node isum;
+	struct jffs2_raw_summary isum;
 	struct jffs2_sum_marker *sm;
 	union jffs2_sum_mem *temp;
 	jint32_t offset;
@@ -378,7 +378,7 @@
 		return; 
 
 	datasize = sum_collected->sum_size + sizeof(struct jffs2_sum_marker);
-	infosize = sizeof(struct jffs2_summary_node) + datasize;
+	infosize = sizeof(struct jffs2_raw_summary) + datasize;
 	padsize = erase_block_size - data_ofs - infosize;
 	infosize += padsize; datasize += padsize;
 	offset = cpu_to_je32(data_ofs);
@@ -501,7 +501,7 @@
 static inline void pad_block_if_less_than(int req,int plus)
 {
 
-	int datasize = req + plus + sum_collected->sum_size + sizeof(struct jffs2_summary_node) + 8;
+	int datasize = req + plus + sum_collected->sum_size + sizeof(struct jffs2_raw_summary) + 8;
 	datasize += (4 - (datasize % 4)) % 4;
 
 	if (data_ofs + req > erase_block_size - datasize) {
@@ -524,7 +524,7 @@
 	if ((add_cleanmarkers == 1) && (found_cleanmarkers == 1)) { /* CLEANMARKER */
 		if (data_ofs != cleanmarker_size) {	/* INODE BUFFER */
 
-			int datasize = sum_collected->sum_size + sizeof(struct jffs2_summary_node) + 8;
+			int datasize = sum_collected->sum_size + sizeof(struct jffs2_raw_summary) + 8;
 			datasize += (4 - (datasize % 4)) % 4;
 
 			/* If we have a full inode buffer, then write out inode and summary data  */
@@ -540,7 +540,7 @@
 	} else { /* NO CLEANMARKER */
 		if (data_ofs != 0) { /* INODE BUFFER */
 
-			int datasize = sum_collected->sum_size + sizeof(struct jffs2_summary_node) + 8;
+			int datasize = sum_collected->sum_size + sizeof(struct jffs2_raw_summary) + 8;
 			datasize += (4 - (datasize % 4)) % 4;
 
 			/* If we have a full inode buffer, then write out inode and summary data */





More information about the linux-mtd-cvs mailing list