projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix problem when accessing unmounted fs
[yaffs2.git]
/
yaffs_guts.c
diff --git
a/yaffs_guts.c
b/yaffs_guts.c
index 340c7366cee299d2a97d062a404d782a2266c263..740a2563dd9ed3261e631d2bee0eb7cd62a5647a 100644
(file)
--- a/
yaffs_guts.c
+++ b/
yaffs_guts.c
@@
-1,19
+1,20
@@
+
/*
/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- * yaffs_guts.c The main guts of YAFFS
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
*
* Copyright (C) 2002 Aleph One Ltd.
* for Toby Churchill Ltd and Brightstar Engineering
*
* Created by Charles Manning <charles@aleph1.co.uk>
*
*
* Copyright (C) 2002 Aleph One Ltd.
* for Toby Churchill Ltd and Brightstar Engineering
*
* Created by Charles Manning <charles@aleph1.co.uk>
*
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
//yaffs_guts.c
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
//yaffs_guts.c
-const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.
3 2004-11-22 03:22:25
charles Exp $";
+const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.
5 2005-03-16 04:00:36
charles Exp $";
#include "yportenv.h"
#include "yportenv.h"
@@
-475,7
+476,8
@@
int yaffs_CheckFF(__u8 *buffer,int nBytes)
//Horrible, slow implementation
while(nBytes--)
{
//Horrible, slow implementation
while(nBytes--)
{
- if(*buffer != 0xFF) return 0;
+ if(*buffer != 0xFF) return 0;
+ buffer++;
}
return 1;
}
}
return 1;
}
@@
-487,7
+489,8
@@
static int yaffs_CheckChunkErased(struct yaffs_DeviceStruct *dev,int chunkInNAND
__u8 *data = yaffs_GetTempBuffer(dev,__LINE__);
yaffs_ExtendedTags tags;
__u8 *data = yaffs_GetTempBuffer(dev,__LINE__);
yaffs_ExtendedTags tags;
- dev->readChunkWithTagsFromNAND(dev,chunkInNAND,data,&tags);
+// NCB dev->readChunkWithTagsFromNAND(dev,chunkInNAND,data,&tags);
+ yaffs_ReadChunkWithTagsFromNAND(dev,chunkInNAND,data,&tags);
if(!yaffs_CheckFF(data,dev->nBytesPerChunk) || tags.chunkUsed)
{
if(!yaffs_CheckFF(data,dev->nBytesPerChunk) || tags.chunkUsed)
{
@@
-4525,7
+4528,7
@@
static int yaffs_Scan(yaffs_Device *dev)
yaffs_BlockIndex *blockIndex = NULL;
yaffs_BlockIndex *blockIndex = NULL;
- T(YAFFS_TRACE_SCAN,(TSTR("yaffs_Scan starts
..." TENDSTR)
));
+ T(YAFFS_TRACE_SCAN,(TSTR("yaffs_Scan starts
startblk %d endblk %d..." TENDSTR),dev->startBlock,dev->endBlock
));
chunkData = yaffs_GetTempBuffer(dev,__LINE__);
chunkData = yaffs_GetTempBuffer(dev,__LINE__);
@@
-4550,6
+4553,8
@@
static int yaffs_Scan(yaffs_Device *dev)
bi->blockState = state;
bi->sequenceNumber = sequenceNumber;
bi->blockState = state;
bi->sequenceNumber = sequenceNumber;
+
+ T(YAFFS_TRACE_SCAN_DEBUG,(TSTR("Block scanning block %d state %d seq %d" TENDSTR),blk,state,sequenceNumber));
if(state == YAFFS_BLOCK_STATE_DEAD)
{
if(state == YAFFS_BLOCK_STATE_DEAD)
{
@@
-4557,6
+4562,7
@@
static int yaffs_Scan(yaffs_Device *dev)
}
else if(state == YAFFS_BLOCK_STATE_EMPTY)
{
}
else if(state == YAFFS_BLOCK_STATE_EMPTY)
{
+ T(YAFFS_TRACE_SCAN_DEBUG,(TSTR("Block empty " TENDSTR)));
dev->nErasedBlocks++;
dev->nFreeChunks += dev->nChunksPerBlock;
}
dev->nErasedBlocks++;
dev->nFreeChunks += dev->nChunksPerBlock;
}
@@
-4612,6
+4618,7
@@
static int yaffs_Scan(yaffs_Device *dev)
{
startIterator = 0;
endIterator = nBlocksToScan-1;
{
startIterator = 0;
endIterator = nBlocksToScan-1;
+ T(YAFFS_TRACE_SCAN_DEBUG,(TSTR("%d blocks to be scanned" TENDSTR),nBlocksToScan));
}
else
{
}
else
{
@@
-5697,4
+5704,3
@@
void yaffs_GutsTest(yaffs_Device *dev)
#endif
#endif
-