summaryrefslogtreecommitdiff
path: root/fs/yaffs2/yaffs_checkptrw.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/yaffs2/yaffs_checkptrw.c')
-rw-r--r--fs/yaffs2/yaffs_checkptrw.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/yaffs2/yaffs_checkptrw.c b/fs/yaffs2/yaffs_checkptrw.c
index 288b550ae4df..66a4e7d9f0f9 100644
--- a/fs/yaffs2/yaffs_checkptrw.c
+++ b/fs/yaffs2/yaffs_checkptrw.c
@@ -43,6 +43,9 @@ static int yaffs_CheckpointErase(yaffs_Device *dev)
yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, i);
if (bi->blockState == YAFFS_BLOCK_STATE_CHECKPOINT) {
T(YAFFS_TRACE_CHECKPOINT, (TSTR("erasing checkpt block %d"TENDSTR), i));
+
+ dev->nBlockErasures++;
+
if (dev->eraseBlockInNAND(dev, i - dev->blockOffset /* realign */)) {
bi->blockState = YAFFS_BLOCK_STATE_EMPTY;
dev->nErasedBlocks++;
@@ -168,6 +171,9 @@ int yaffs_CheckpointOpen(yaffs_Device *dev, int forWriting)
dev->blocksInCheckpoint = 0;
dev->checkpointMaxBlocks = (dev->internalEndBlock - dev->internalStartBlock)/16 + 2;
dev->checkpointBlockList = YMALLOC(sizeof(int) * dev->checkpointMaxBlocks);
+ if(!dev->checkpointBlockList)
+ return 0;
+
for (i = 0; i < dev->checkpointMaxBlocks; i++)
dev->checkpointBlockList[i] = -1;
}
@@ -219,6 +225,8 @@ static int yaffs_CheckpointFlushBuffer(yaffs_Device *dev)
realignedChunk = chunk - dev->chunkOffset;
+ dev->nPageWrites++;
+
dev->writeChunkWithTagsToNAND(dev, realignedChunk,
dev->checkpointBuffer, &tags);
dev->checkpointByteOffset = 0;
@@ -306,6 +314,8 @@ int yaffs_CheckpointRead(yaffs_Device *dev, void *data, int nBytes)
dev->checkpointCurrentChunk;
realignedChunk = chunk - dev->chunkOffset;
+
+ dev->nPageReads++;
/* read in the next chunk */
/* printf("read checkpoint page %d\n",dev->checkpointPage); */