X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_nand.c;h=38989851ed7f24f4267f74a7fccd6af8a1e8327d;hp=c33483c3599b8caadd5dd459514ac355ef96bb82;hb=457fb8efdcd9b61c657b8b03b942f048eaa5168c;hpb=e1ac494e05a5dc7ab61d799af815d103a11d318c diff --git a/yaffs_nand.c b/yaffs_nand.c index c33483c..3898985 100644 --- a/yaffs_nand.c +++ b/yaffs_nand.c @@ -10,9 +10,9 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - + const char *yaffs_nand_c_version = - "$Id: yaffs_nand.c,v 1.7 2007-02-14 01:09:06 wookey Exp $"; + "$Id: yaffs_nand.c,v 1.8 2007-12-13 15:35:18 wookey Exp $"; #include "yaffs_nand.h" #include "yaffs_tagscompat.h" @@ -25,9 +25,9 @@ int yaffs_ReadChunkWithTagsFromNAND(yaffs_Device * dev, int chunkInNAND, { int result; yaffs_ExtendedTags localTags; - + int realignedChunkInNAND = chunkInNAND - dev->chunkOffset; - + /* If there are no tags provided, use local tags to get prioritised gc working */ if(!tags) tags = &localTags; @@ -39,14 +39,14 @@ int yaffs_ReadChunkWithTagsFromNAND(yaffs_Device * dev, int chunkInNAND, result = yaffs_TagsCompatabilityReadChunkWithTagsFromNAND(dev, realignedChunkInNAND, buffer, - tags); - if(tags && + tags); + if(tags && tags->eccResult > YAFFS_ECC_RESULT_NO_ERROR){ - + yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, chunkInNAND/dev->nChunksPerBlock); yaffs_HandleChunkError(dev,bi); } - + return result; } @@ -57,7 +57,7 @@ int yaffs_WriteChunkWithTagsToNAND(yaffs_Device * dev, { chunkInNAND -= dev->chunkOffset; - + if (tags) { tags->sequenceNumber = dev->sequenceNumber; tags->chunkUsed = 1; @@ -131,4 +131,4 @@ int yaffs_InitialiseNAND(struct yaffs_DeviceStruct *dev) } - +