X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_tagscompat.c;h=e3173cc2e23b1d237928a298ef221c7829535203;hp=1e0a1a1b195d583316b8e414e9642e80c2e779cb;hb=96aed5b90237cda3b8168a957be33c83ae192794;hpb=3e5718ec7f0df7b76837d10583419b745cb27474 diff --git a/yaffs_tagscompat.c b/yaffs_tagscompat.c index 1e0a1a1..e3173cc 100644 --- a/yaffs_tagscompat.c +++ b/yaffs_tagscompat.c @@ -170,7 +170,6 @@ static int yaffs_WriteChunkToNAND(struct yaffs_DeviceStruct *dev, return YAFFS_FAIL; } - dev->nPageWrites++; return dev->writeChunkToNAND(dev, chunkInNAND, data, spare); } @@ -184,8 +183,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 +405,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); }