X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=yaffs_guts.c;h=87fa7a99d2e3ff82aadce48b6b059d14971db519;hb=006295ce3f5da43a1ddff9e385f8f8248c6dcb07;hp=7c97b314bfd1d2be9d5ce70e42e0324099edc728;hpb=b91298ceff82f7f47539ec0308c6b310e1d9e755;p=yaffs%2F.git diff --git a/yaffs_guts.c b/yaffs_guts.c index 7c97b31..87fa7a9 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -14,7 +14,7 @@ */ //yaffs_guts.c -const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.37 2004-10-20 20:12:43 charles Exp $"; +const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.40 2005-04-05 03:45:40 charles Exp $"; #include "yportenv.h" @@ -1623,6 +1623,11 @@ yaffs_Object *yaffs_FindObjectByNumber(yaffs_Device *dev,__u32 number) in = list_entry(i, yaffs_Object,hashLink); if(in->objectId == number) { +#ifdef __KERNEL__ + // Don't tell the VFS about this if it has been marked for freeing + if(in->deferedFree) + return NULL; +#endif return in; } } @@ -3136,7 +3141,7 @@ static void yaffs_FlushFilesChunkCache(yaffs_Object *obj) int lowest; int i; yaffs_ChunkCache *cache; - int chunkWritten; + int chunkWritten = 0; int nBytes; int nCaches = obj->myDev->nShortOpCaches; @@ -3765,6 +3770,7 @@ static int yaffs_DoGenericObjectDeletion(yaffs_Object *in) yaffs_RemoveObjectFromDirectory(in); yaffs_DeleteChunk(in->myDev,in->chunkId,1); + in->chunkId = -1; #if 0 #ifdef __KERNEL__ if(in->myInode) @@ -4783,6 +4789,7 @@ int yaffs_GutsInitialise(yaffs_Device *dev) dev->eccUnfixed=0; dev->tagsEccFixed=0; dev->tagsEccUnfixed=0; + dev->nErasedBlocks=0; dev->localBuffer = YMALLOC(dev->nBytesPerChunk); @@ -4855,6 +4862,7 @@ void yaffs_Deinitialise(yaffs_Device *dev) if(dev->nShortOpCaches > 0) YFREE(dev->srCache); YFREE(dev->localBuffer); + dev->isMounted = 0; } }