summaryrefslogtreecommitdiff
path: root/yaffs_nand.c
diff options
context:
space:
mode:
authorcharles <charles>2006-09-21 08:13:59 +0000
committercharles <charles>2006-09-21 08:13:59 +0000
commita8e9cfa2968a5f16ff9ae578cc1d3202ebef8725 (patch)
tree83826466dcc5bf58777d7d322fc7868aaf2755ab /yaffs_nand.c
parent20488750f4e5df4cec34f2bd4db39ab7e075d0a9 (diff)
Better retirement and erasure checking.
Diffstat (limited to 'yaffs_nand.c')
-rw-r--r--yaffs_nand.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/yaffs_nand.c b/yaffs_nand.c
index cd39d51..989e8d9 100644
--- a/yaffs_nand.c
+++ b/yaffs_nand.c
@@ -13,7 +13,7 @@
*/
const char *yaffs_nand_c_version =
- "$Id: yaffs_nand.c,v 1.1 2006-05-08 10:13:34 charles Exp $";
+ "$Id: yaffs_nand.c,v 1.2 2006-09-21 08:13:59 charles Exp $";
#include "yaffs_nand.h"
#include "yaffs_tagscompat.h"
@@ -24,16 +24,26 @@ int yaffs_ReadChunkWithTagsFromNAND(yaffs_Device * dev, int chunkInNAND,
__u8 * buffer,
yaffs_ExtendedTags * tags)
{
- chunkInNAND -= dev->chunkOffset;
+ int result;
+
+ int realignedChunkInNAND = chunkInNAND - dev->chunkOffset;
if (dev->readChunkWithTagsFromNAND)
- return dev->readChunkWithTagsFromNAND(dev, chunkInNAND, buffer,
+ result = dev->readChunkWithTagsFromNAND(dev, realignedChunkInNAND, buffer,
tags);
else
- return yaffs_TagsCompatabilityReadChunkWithTagsFromNAND(dev,
- chunkInNAND,
+ result = yaffs_TagsCompatabilityReadChunkWithTagsFromNAND(dev,
+ realignedChunkInNAND,
buffer,
- tags);
+ tags);
+ if(tags &&
+ tags->eccResult > YAFFS_ECC_RESULT_NO_ERROR){
+
+ yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, chunkInNAND/dev->nChunksPerBlock);
+ bi->gcPrioritise = 1;
+ }
+
+ return result;
}
int yaffs_WriteChunkWithTagsToNAND(yaffs_Device * dev,