X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_guts.c;h=389a57ca79f25efb475ef3e1311f3e6e4ab3c8b5;hp=c01f00c8b6b37239d9562a6bbf8461d486ce8308;hb=46f347899188a1491d8f3f43cb47495766aa839a;hpb=107910497be0a0d0e4a8ab357c403fc2a234323b diff --git a/yaffs_guts.c b/yaffs_guts.c index c01f00c..389a57c 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -2223,6 +2223,7 @@ static int yaffs_GarbageCollectBlock(yaffs_Device *dev, int block, * We have to decrement free chunks so this works out properly. */ dev->nFreeChunks--; + bi->softDeletions--; object->nDataChunks--; @@ -2499,8 +2500,10 @@ static unsigned yaffs_FindBlockForGarbageCollection(yaffs_Device *dev, dev->param.nChunksPerBlock - dev->gcPagesInUse, prioritised)); + dev->nGCBlocks++; if(background) dev->backgroundGCs++; + dev->gcDirtiest = 0; dev->gcPagesInUse = 0; dev->gcNotDone = 0; @@ -4189,6 +4192,9 @@ static void yaffs_StripDeletedObjects(yaffs_Device *dev) struct ylist_head *n; yaffs_Object *l; + if (dev->readOnly) + return; + /* Soft delete all the unlinked files */ ylist_for_each_safe(i, n, &dev->unlinkedDir->variant.directoryVariant.children) { @@ -4242,6 +4248,8 @@ static void yaffs_FixHangingObjects(yaffs_Device *dev) int depthLimit; int hanging; + if (dev->readOnly) + return; /* Iterate through the objects in each hash entry, * looking at each object.