From 4240c717c7a8e97d0cef48caf4dd9b2956e50495 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Tue, 25 Jan 2005 21:05:38 +0000 Subject: [PATCH] - 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 --- reactos/drivers/fs/vfat/cleanup.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/reactos/drivers/fs/vfat/cleanup.c b/reactos/drivers/fs/vfat/cleanup.c index b8b07e86e12..df24e8cbef0 100644 --- a/reactos/drivers/fs/vfat/cleanup.c +++ b/reactos/drivers/fs/vfat/cleanup.c @@ -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); }