From: charles Date: Wed, 9 Sep 2009 00:56:53 +0000 (+0000) Subject: No need to do chunk finding the group has one chunk X-Git-Tag: pre-name-change~200 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=f1c0bdf3f2139433a5510a0a320d53fd2fcb61ed No need to do chunk finding the group has one chunk --- 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++;