From: Pierre Schweitzer Date: Sat, 29 Nov 2014 20:26:07 +0000 (+0000) Subject: [FASTFAT] X-Git-Tag: ReactOS-0.3.17-FOSDEM2015~548 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=e85718fec8c43e72551527c4b4585e5609ec3283 [FASTFAT] - Add a flag to enable (or disable depends on your reading ;-)) the VPB swapout process for volume umount. - By default, disable it for MSVC builds. This *might* lolfix the MSVC builds. Just for the record, we also have a bug in the GCC builds but it doesn't seem to show up. The main issue is that after formatting, we close handle to the volume, and IRP_MJ_CLEANUP is properly received and initiates a bit of dismount. But then, the IRP_MJ_CLOSE is never received (why????) and thus, dismount cannot properly end. This is a real & serious issue. svn path=/trunk/; revision=65527 --- diff --git a/reactos/drivers/filesystems/fastfat/cleanup.c b/reactos/drivers/filesystems/fastfat/cleanup.c index 6d64ee15c6c..b6bbae08c14 100644 --- a/reactos/drivers/filesystems/fastfat/cleanup.c +++ b/reactos/drivers/filesystems/fastfat/cleanup.c @@ -110,10 +110,12 @@ VfatCleanupFile( ExReleaseResourceLite(&pFcb->MainResource); } +#ifdef ENABLE_SWAPOUT if (DeviceExt->Flags & VCB_DISMOUNT_PENDING) { VfatCheckForDismount(DeviceExt, FALSE); } +#endif return STATUS_SUCCESS; } diff --git a/reactos/drivers/filesystems/fastfat/close.c b/reactos/drivers/filesystems/fastfat/close.c index 54a1280f180..1f8d3b1e14c 100644 --- a/reactos/drivers/filesystems/fastfat/close.c +++ b/reactos/drivers/filesystems/fastfat/close.c @@ -82,10 +82,12 @@ VfatCloseFile( vfatDestroyCCB(pCcb); } +#ifdef ENABLE_SWAPOUT if (DeviceExt->OpenHandleCount == 0) { VfatCheckForDismount(DeviceExt, FALSE); } +#endif return Status; } diff --git a/reactos/drivers/filesystems/fastfat/fsctl.c b/reactos/drivers/filesystems/fastfat/fsctl.c index aa50d46bd2e..83680909d06 100644 --- a/reactos/drivers/filesystems/fastfat/fsctl.c +++ b/reactos/drivers/filesystems/fastfat/fsctl.c @@ -977,6 +977,9 @@ VfatDismountVolume( /* Mark we're being dismounted */ DeviceExt->Flags |= VCB_DISMOUNT_PENDING; +#ifndef ENABLE_SWAPOUT + IrpContext->DeviceObject->Vpb->Flags &= ~VPB_MOUNTED; +#endif ExReleaseResourceLite(&DeviceExt->FatResource); diff --git a/reactos/drivers/filesystems/fastfat/vfat.h b/reactos/drivers/filesystems/fastfat/vfat.h index 15a91f2b338..b6d4c897047 100644 --- a/reactos/drivers/filesystems/fastfat/vfat.h +++ b/reactos/drivers/filesystems/fastfat/vfat.h @@ -7,6 +7,9 @@ #include #define USE_ROS_CC_AND_FS +#ifndef _MSC_VER +#define ENABLE_SWAPOUT +#endif #define ROUND_DOWN(n, align) \ (((ULONG)n) & ~((align) - 1l))