changeset 304:003f31df02fc

No need to do chunk finding the group has one chunk
author charles
date Wed, 09 Sep 2009 01:56:53 +0100
parents 22f72a12de73
children 1e8f7df58d5e
files yaffs_guts.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/yaffs_guts.c
+++ b/yaffs_guts.c
@@ -1545,11 +1545,16 @@ static int yaffs_FindChunkInGroup(yaffs_
 	for (j = 0; theChunk && j < dev->chunkGroupSize; j++) {
 		if (yaffs_CheckChunkBit(dev, theChunk / dev->nChunksPerBlock,
 				theChunk % dev->nChunksPerBlock)) {
-			yaffs_ReadChunkWithTagsFromNAND(dev, theChunk, NULL,
-							tags);
-			if (yaffs_TagsMatch(tags, objectId, chunkInInode)) {
-				/* found it; */
+			
+			if(dev->chunkGroupSize == 1)
 				return theChunk;
+			else {
+				yaffs_ReadChunkWithTagsFromNAND(dev, theChunk, NULL,
+								tags);
+				if (yaffs_TagsMatch(tags, objectId, chunkInInode)) {
+					/* found it; */
+					return theChunk;
+				}
 			}
 		}
 		theChunk++;