- Always try to uninitialize the file cache in VfatCleanupFile.

- Try to purge the file cache if the last handle is closed and deleting of the file was requested.

svn path=/trunk/; revision=13276
This commit is contained in:
Hartmut Birr 2005-01-25 21:05:38 +00:00
parent afec493812
commit 4240c717c7

View file

@ -46,16 +46,22 @@ VfatCleanupFile(PVFAT_IRP_CONTEXT IrpContext)
VfatUpdateEntry (pFcb);
}
/* Uninitialize file cache if initialized for this file object. */
if (FileObject->PrivateCacheMap)
if (pFcb->Flags & FCB_DELETE_PENDING &&
pFcb->OpenHandleCount == 1)
{
#ifdef USE_ROS_CC_AND_FS
CcRosReleaseFileCache (FileObject);
#else
CcUninitializeCacheMap (FileObject, NULL, NULL);
#if 0
/* FIXME:
* CcPurgeCacheSection is unimplemented.
*/
CcPurgeCacheSection(FileObject->SectionObjectPointer, NULL, 0, FALSE);
#endif
}
/* Uninitialize file cache if. */
#ifdef USE_ROS_CC_AND_FS
CcRosReleaseFileCache (FileObject);
#else
CcUninitializeCacheMap (FileObject, NULL, NULL);
#endif
pFcb->OpenHandleCount--;
IoRemoveShareAccess(FileObject, &pFcb->FCBShareAccess);
}