X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs%2F.git;a=blobdiff_plain;f=yaffs_guts.c;fp=yaffs_guts.c;h=d8cdcb7f150a97addca40dcacb71e00ae845a091;hp=7c97b314bfd1d2be9d5ce70e42e0324099edc728;hb=7b5f93e758d963355b31ce0a1f0eafa16074f35d;hpb=efaca198e4520ddd402d0ae5e118ceafea25a2f4 diff --git a/yaffs_guts.c b/yaffs_guts.c index 7c97b31..d8cdcb7 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.38 2005-01-06 23:28:34 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)