* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
- * $Id: yaffs_tagscompat.c,v 1.6 2005-08-11 02:33:03 marty Exp $
+ * $Id: yaffs_tagscompat.c,v 1.8 2005-11-29 20:54:32 marty Exp $
*/
#include "yaffs_guts.h"
if (eccResult1 > 0) {
T(YAFFS_TRACE_ERROR,
(TSTR
- ("**>>ecc error fix performed on chunk %d:0"
+ ("**>>yaffs ecc error fix performed on chunk %d:0"
TENDSTR), chunkInNAND));
dev->eccFixed++;
} else if (eccResult1 < 0) {
T(YAFFS_TRACE_ERROR,
(TSTR
- ("**>>ecc error unfixed on chunk %d:0"
+ ("**>>yaffs ecc error unfixed on chunk %d:0"
TENDSTR), chunkInNAND));
dev->eccUnfixed++;
}
if (eccResult2 > 0) {
T(YAFFS_TRACE_ERROR,
(TSTR
- ("**>>ecc error fix performed on chunk %d:1"
+ ("**>>yaffs ecc error fix performed on chunk %d:1"
TENDSTR), chunkInNAND));
dev->eccFixed++;
} else if (eccResult2 < 0) {
T(YAFFS_TRACE_ERROR,
(TSTR
- ("**>>ecc error unfixed on chunk %d:1"
+ ("**>>yaffs ecc error unfixed on chunk %d:1"
TENDSTR), chunkInNAND));
dev->eccUnfixed++;
}
if (nspare.eccres1 > 0) {
T(YAFFS_TRACE_ERROR,
(TSTR
- ("**>>ecc error fix performed on chunk %d:0"
+ ("**>>mtd ecc error fix performed on chunk %d:0"
TENDSTR), chunkInNAND));
} else if (nspare.eccres1 < 0) {
T(YAFFS_TRACE_ERROR,
(TSTR
- ("**>>ecc error unfixed on chunk %d:0"
+ ("**>>mtd ecc error unfixed on chunk %d:0"
TENDSTR), chunkInNAND));
}
if (nspare.eccres2 > 0) {
T(YAFFS_TRACE_ERROR,
(TSTR
- ("**>>ecc error fix performed on chunk %d:1"
+ ("**>>mtd ecc error fix performed on chunk %d:1"
TENDSTR), chunkInNAND));
} else if (nspare.eccres2 < 0) {
T(YAFFS_TRACE_ERROR,
(TSTR
- ("**>>ecc error unfixed on chunk %d:1"
+ ("**>>mtd ecc error unfixed on chunk %d:1"
TENDSTR), chunkInNAND));
}
int deleted =
(yaffs_CountBits(spare.pageStatus) < 7) ? 1 : 0;
- yaffs_GetTagsFromSpare(dev, &spare, &tags);
-
eTags->chunkDeleted = deleted;
- eTags->objectId = tags.objectId;
- eTags->chunkId = tags.chunkId;
- eTags->byteCount = tags.byteCount;
- eTags->serialNumber = tags.serialNumber;
eTags->eccResult = eccResult;
eTags->blockBad = 0; /* We're reading it */
/* therefore it is not a bad block */
-
eTags->chunkUsed =
(memcmp(&spareFF, &spare, sizeof(spareFF)) !=
0) ? 1 : 0;
+
+ if (eTags->chunkUsed) {
+ yaffs_GetTagsFromSpare(dev, &spare, &tags);
+
+ eTags->objectId = tags.objectId;
+ eTags->chunkId = tags.chunkId;
+ eTags->byteCount = tags.byteCount;
+ eTags->serialNumber = tags.serialNumber;
+ }
}
return YAFFS_OK;