In some corner cases soft deletion could cause NAND to leak and show
up in lost and found.
This only impacts yaffs1 mode.
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
int newChunk;
int markNAND;
int retVal = YAFFS_OK;
int newChunk;
int markNAND;
int retVal = YAFFS_OK;
int i;
int isCheckpointBlock;
int matchingChunk;
int i;
int isCheckpointBlock;
int matchingChunk;
if (object->nDataChunks <= 0) {
/* remeber to clean up the object */
if (object->nDataChunks <= 0) {
/* remeber to clean up the object */
- dev->gcCleanupList[cleanups] =
+ dev->gcCleanupList[dev->nCleanups] =
}
markNAND = 0;
} else if (0) {
}
markNAND = 0;
} else if (0) {
yaffs_ReleaseTempBuffer(dev, buffer, __LINE__);
yaffs_ReleaseTempBuffer(dev, buffer, __LINE__);
+
+ }
+
+ yaffs_VerifyCollectedBlock(dev, bi, block);
+
+
+
+ if (bi->blockState == YAFFS_BLOCK_STATE_COLLECTING) {
+ /*
+ * The gc did not complete. Set block state back to FULL
+ * because checkpointing does not restore gc.
+ */
+ bi->blockState = YAFFS_BLOCK_STATE_FULL;
+ } else {
+ /* The gc completed. */
/* Do any required cleanups */
/* Do any required cleanups */
- for (i = 0; i < cleanups; i++) {
+ for (i = 0; i < dev->nCleanups; i++) {
/* Time to delete the file too */
object =
yaffs_FindObjectByNumber(dev,
/* Time to delete the file too */
object =
yaffs_FindObjectByNumber(dev,
- }
-
- yaffs_VerifyCollectedBlock(dev, bi, block);
-
-
- if (bi->blockState == YAFFS_BLOCK_STATE_COLLECTING) {
- /*
- * The gc did not complete. Set block state back to FULL
- * because checkpointing does not restore gc.
- */
- bi->blockState = YAFFS_BLOCK_STATE_FULL;
- } else {
- /* The gc completed. */
chunksAfter = yaffs_GetErasedChunks(dev);
if (chunksBefore >= chunksAfter) {
T(YAFFS_TRACE_GC,
chunksAfter = yaffs_GetErasedChunks(dev);
if (chunksBefore >= chunksAfter) {
T(YAFFS_TRACE_GC,
}
dev->gcBlock = 0;
dev->gcChunk = 0;
}
dev->gcBlock = 0;
dev->gcChunk = 0;
if (dev->gcBlock < 1 && !aggressive) {
dev->gcBlock = yaffs2_FindRefreshBlock(dev);
dev->gcChunk = 0;
if (dev->gcBlock < 1 && !aggressive) {
dev->gcBlock = yaffs2_FindRefreshBlock(dev);
dev->gcChunk = 0;
}
if (dev->gcBlock < 1) {
dev->gcBlock = yaffs_FindBlockForGarbageCollection(dev, aggressive, background);
dev->gcChunk = 0;
}
if (dev->gcBlock < 1) {
dev->gcBlock = yaffs_FindBlockForGarbageCollection(dev, aggressive, background);
dev->gcChunk = 0;
}
if (dev->gcBlock > 0) {
}
if (dev->gcBlock > 0) {
/* Garbage collection control */
__u32 *gcCleanupList; /* objects to delete at the end of a GC. */
/* Garbage collection control */
__u32 *gcCleanupList; /* objects to delete at the end of a GC. */
unsigned hasPendingPrioritisedGCs; /* We think this device might have pending prioritised gcs */
unsigned gcDisable;
unsigned hasPendingPrioritisedGCs; /* We think this device might have pending prioritised gcs */
unsigned gcDisable;