diff yaffs_packedtags2.c @ 24:4ebabd859f38

Some improvements to garbage collection and st_xxx to yst_xxx changes
author charles
date Tue, 19 Jul 2005 00:16:04 +0100
parents 25dfba77df6a
children 4a79e23a3570
line wrap: on
line diff
--- a/yaffs_packedtags2.c
+++ b/yaffs_packedtags2.c
@@ -89,8 +89,11 @@ void yaffs_PackTags2(yaffs_PackedTags2 *
 	yaffs_DumpPackedTags2(pt);
 	yaffs_DumpTags2(t);
 	
-	yaffs_ECCCalculateOther((unsigned char *)&pt->t,sizeof(yaffs_PackedTags2TagsPart),&pt->ecc);
-	
+#ifndef YAFFS_IGNORE_TAGS_ECC
+	{ 
+	  yaffs_ECCCalculateOther((unsigned char *)&pt->t,sizeof(yaffs_PackedTags2TagsPart),&pt->ecc);
+	}
+#endif
 }
 
 void yaffs_UnpackTags2(yaffs_ExtendedTags *t, yaffs_PackedTags2 *pt)
@@ -104,9 +107,17 @@ void yaffs_UnpackTags2(yaffs_ExtendedTag
 	if(pt->t.sequenceNumber != 0xFFFFFFFF)
 	{
 		// Page is in use
-		yaffs_ECCOther ecc;
-		yaffs_ECCCalculateOther((unsigned char *)&pt->t,sizeof(yaffs_PackedTags2TagsPart),&ecc);
-		t->eccResult = yaffs_ECCCorrectOther((unsigned char *)&pt->t,sizeof(yaffs_PackedTags2TagsPart),&pt->ecc,&ecc);
+#ifdef YAFFS_IGNORE_TAGS_ECC
+		{
+			t->eccResult = 0;
+		}
+#else
+		{
+			yaffs_ECCOther ecc;
+			yaffs_ECCCalculateOther((unsigned char *)&pt->t,sizeof(yaffs_PackedTags2TagsPart),&ecc);
+			t->eccResult = yaffs_ECCCorrectOther((unsigned char *)&pt->t,sizeof(yaffs_PackedTags2TagsPart),&pt->ecc,&ecc);
+		}
+#endif
 		t->blockBad = 0;
 		t->chunkUsed = 1;
 		t->objectId = pt->t.objectId;