*/
const char *yaffs_guts_c_version =
- "$Id: yaffs_guts.c,v 1.58 2008-07-03 20:06:05 charles Exp $";
+ "$Id: yaffs_guts.c,v 1.59 2008-07-21 01:03:19 charles Exp $";
#include "yportenv.h"
__u8 *chunkData;
- //TODO Throw all the yaffs2 stuuf out of yaffs_Scan since it is only for yaffs1 format.
T(YAFFS_TRACE_SCAN,
(TSTR("yaffs_Scan starts intstartblk %d intendblk %d..." TENDSTR),
/* Let's have a good look at this chunk... */
- if (!dev->isYaffs2 && tags.chunkDeleted) {
+ if (tags.eccResult == YAFFS_ECC_RESULT_UNFIXED || tags.chunkDeleted) {
/* YAFFS1 only...
* A deleted chunk
*/
dev->allocationBlockFinder = blk;
/* Set it to here to encourage the allocator to go forth from here. */
- /* Yaffs2 sanity check:
- * This should be the one with the highest sequence number
- */
- if (dev->isYaffs2
- && (dev->sequenceNumber !=
- bi->sequenceNumber)) {
- T(YAFFS_TRACE_ALWAYS,
- (TSTR
- ("yaffs: Allocation block %d was not highest sequence id: block seq = %d, dev seq = %d"
- TENDSTR), blk,bi->sequenceNumber,dev->sequenceNumber));
- }
}
dev->nFreeChunks += (dev->nChunksPerBlock - c);
unsigned existingSerial = in->serial;
unsigned newSerial = tags.serialNumber;
- if (dev->isYaffs2 ||
- ((existingSerial + 1) & 3) ==
- newSerial) {
+ if (((existingSerial + 1) & 3) == newSerial) {
/* Use new one - destroy the exisiting one */
yaffs_DeleteChunk(dev,
in->hdrChunk,
/* Todo got a problem */
break;
case YAFFS_OBJECT_TYPE_FILE:
- if (dev->isYaffs2
- && oh->isShrink) {
- /* Prune back the shrunken chunks */
- yaffs_PruneResizedChunks
- (in, oh->fileSize);
- /* Mark the block as having a shrinkHeader */
- bi->hasShrinkHeader = 1;
- }
-
if (dev->useHeaderFileSize)
in->variant.fileVariant.
} else if (state == YAFFS_BLOCK_STATE_NEEDS_SCANNING) {
/* Determine the highest sequence number */
- if (dev->isYaffs2 &&
- sequenceNumber >= YAFFS_LOWEST_SEQUENCE_NUMBER &&
+ if (sequenceNumber >= YAFFS_LOWEST_SEQUENCE_NUMBER &&
sequenceNumber < YAFFS_HIGHEST_SEQUENCE_NUMBER) {
blockIndex[nBlocksToScan].seq = sequenceNumber;
if (sequenceNumber >= dev->sequenceNumber) {
dev->sequenceNumber = sequenceNumber;
}
- } else if (dev->isYaffs2) {
+ } else {
/* TODO: Nasty sequence number! */
T(YAFFS_TRACE_SCAN,
(TSTR
* had a write failure, so set up for retirement.
*/
- bi->needsRetiring = 1;
+ /* bi->needsRetiring = 1; ??? TODO */
bi->gcPrioritise = 1;
T(YAFFS_TRACE_ALWAYS,
- (TSTR("Partially written block %d being set for retirement" TENDSTR),
+ (TSTR("Partially written block %d detected" TENDSTR),
blk));
}