X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_tagscompat.c;h=020eee5356734e84f459885771590d52496d5dec;hp=1e0a1a1b195d583316b8e414e9642e80c2e779cb;hb=fbf2605a5dad8cf93170499d4227064996cce12f;hpb=3e5718ec7f0df7b76837d10583419b745cb27474 diff --git a/yaffs_tagscompat.c b/yaffs_tagscompat.c index 1e0a1a1..020eee5 100644 --- a/yaffs_tagscompat.c +++ b/yaffs_tagscompat.c @@ -15,6 +15,7 @@ #include "yaffs_tagscompat.h" #include "yaffs_ecc.h" #include "yaffs_getblockinfo.h" +#include "yaffs_trace.h" static void yaffs_HandleReadDataError(yaffs_Device *dev, int chunkInNAND); #ifdef NOTYET @@ -170,7 +171,6 @@ static int yaffs_WriteChunkToNAND(struct yaffs_DeviceStruct *dev, return YAFFS_FAIL; } - dev->nPageWrites++; return dev->writeChunkToNAND(dev, chunkInNAND, data, spare); } @@ -184,8 +184,6 @@ static int yaffs_ReadChunkFromNAND(struct yaffs_DeviceStruct *dev, int retVal; yaffs_Spare localSpare; - dev->nPageReads++; - if (!spare && data) { /* If we don't have a real spare, then we use a local one. */ /* Need this for the calculation of the ecc */ @@ -408,26 +406,25 @@ int yaffs_TagsCompatabilityWriteChunkWithTagsToNAND(yaffs_Device *dev, yaffs_SpareInitialise(&spare); - if (eTags->chunkDeleted) { + if (eTags->chunkDeleted) spare.pageStatus = 0; - } else { + else { tags.objectId = eTags->objectId; tags.chunkId = eTags->chunkId; tags.byteCountLSB = eTags->byteCount & 0x3ff; - if (dev->nDataBytesPerChunk >= 1024) { + if (dev->nDataBytesPerChunk >= 1024) tags.byteCountMSB = (eTags->byteCount >> 10) & 3; - } else { + else tags.byteCountMSB = 3; - } tags.serialNumber = eTags->serialNumber; - if (!dev->useNANDECC && data) { + if (!dev->useNANDECC && data) yaffs_CalcECC(data, &spare); - } + yaffs_LoadTagsIntoSpare(&spare, &tags); }