yaffs: Update stats when using mtdif2.

This commit is contained in:
Arve Hjønnevåg
2009-04-03 19:05:50 -07:00
parent d7288aee18
commit a660ce8105

View File

@@ -52,6 +52,7 @@ int nandmtd2_WriteChunkWithTagsToNAND(yaffs_Device *dev, int chunkInNAND,
("nandmtd2_WriteChunkWithTagsToNAND chunk %d data %p tags %p"
TENDSTR), chunkInNAND, data, tags));
dev->nPageWrites++;
addr = ((loff_t) chunkInNAND) * dev->totalBytesPerChunk;
@@ -115,6 +116,8 @@ int nandmtd2_ReadChunkWithTagsFromNAND(yaffs_Device *dev, int chunkInNAND,
("nandmtd2_ReadChunkWithTagsFromNAND chunk %d data %p tags %p"
TENDSTR), chunkInNAND, data, tags));
dev->nPageReads++;
if (dev->inbandTags) {
if (!data) {
@@ -174,10 +177,14 @@ int nandmtd2_ReadChunkWithTagsFromNAND(yaffs_Device *dev, int chunkInNAND,
if (localData)
yaffs_ReleaseTempBuffer(dev, data, __LINE__);
if (tags && retval == -EBADMSG && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR)
if (tags && retval == -EBADMSG && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR) {
tags->eccResult = YAFFS_ECC_RESULT_UNFIXED;
if (tags && retval == -EUCLEAN && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR)
dev->eccUnfixed++;
}
if (tags && retval == -EUCLEAN && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR) {
tags->eccResult = YAFFS_ECC_RESULT_FIXED;
dev->eccFixed++;
}
if (retval == 0)
return YAFFS_OK;
else