From f1c0bdf3f2139433a5510a0a320d53fd2fcb61ed Mon Sep 17 00:00:00 2001 From: charles Date: Wed, 9 Sep 2009 00:56:53 +0000 Subject: [PATCH] No need to do chunk finding the group has one chunk --- yaffs_guts.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/yaffs_guts.c b/yaffs_guts.c index 15b20ac..2acfb8e 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -12,7 +12,7 @@ */ const char *yaffs_guts_c_version = - "$Id: yaffs_guts.c,v 1.88 2009-08-11 01:28:42 charles Exp $"; + "$Id: yaffs_guts.c,v 1.89 2009-09-09 00:56:53 charles Exp $"; #include "yportenv.h" @@ -1545,11 +1545,16 @@ static int yaffs_FindChunkInGroup(yaffs_Device *dev, int theChunk, 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++; -- 2.30.2