mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:05:49 +00:00
[FASTFAT]
Properly flush volume on dismount svn path=/trunk/; revision=65353
This commit is contained in:
parent
411da63870
commit
da318dabea
1 changed files with 4 additions and 24 deletions
|
@ -913,10 +913,12 @@ VfatDismountVolume(
|
||||||
PDEVICE_EXTENSION DeviceExt;
|
PDEVICE_EXTENSION DeviceExt;
|
||||||
PLIST_ENTRY NextEntry;
|
PLIST_ENTRY NextEntry;
|
||||||
PVFATFCB Fcb;
|
PVFATFCB Fcb;
|
||||||
|
PFILE_OBJECT FileObject;
|
||||||
|
|
||||||
DPRINT("VfatDismountVolume(%p)\n", IrpContext);
|
DPRINT("VfatDismountVolume(%p)\n", IrpContext);
|
||||||
|
|
||||||
DeviceExt = IrpContext->DeviceExt;
|
DeviceExt = IrpContext->DeviceExt;
|
||||||
|
FileObject = IrpContext->FileObject;
|
||||||
|
|
||||||
/* We HAVE to be locked. Windows also allows dismount with no lock
|
/* We HAVE to be locked. Windows also allows dismount with no lock
|
||||||
* but we're here mainly for 1st stage, so KISS
|
* but we're here mainly for 1st stage, so KISS
|
||||||
|
@ -937,30 +939,8 @@ VfatDismountVolume(
|
||||||
|
|
||||||
ExAcquireResourceExclusiveLite(&DeviceExt->FatResource, TRUE);
|
ExAcquireResourceExclusiveLite(&DeviceExt->FatResource, TRUE);
|
||||||
|
|
||||||
/* Browse all the available FCBs first, and force data writing to disk */
|
/* Flush volume & files */
|
||||||
for (NextEntry = DeviceExt->FcbListHead.Flink;
|
VfatFlushVolume(DeviceExt, (PVFATFCB)FileObject->FsContext);
|
||||||
NextEntry != &DeviceExt->FcbListHead;
|
|
||||||
NextEntry = NextEntry->Flink)
|
|
||||||
{
|
|
||||||
Fcb = CONTAINING_RECORD(NextEntry, VFATFCB, FcbListEntry);
|
|
||||||
|
|
||||||
ExAcquireResourceExclusiveLite(&Fcb->MainResource, TRUE);
|
|
||||||
ExAcquireResourceExclusiveLite(&Fcb->PagingIoResource, TRUE);
|
|
||||||
|
|
||||||
if (Fcb->FileObject)
|
|
||||||
{
|
|
||||||
if (Fcb->Flags & FCB_IS_DIRTY)
|
|
||||||
{
|
|
||||||
VfatUpdateEntry(Fcb);
|
|
||||||
}
|
|
||||||
|
|
||||||
CcPurgeCacheSection(Fcb->FileObject->SectionObjectPointer, NULL, 0, FALSE);
|
|
||||||
CcUninitializeCacheMap(Fcb->FileObject, &Fcb->RFCB.FileSize, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
ExReleaseResourceLite(&Fcb->PagingIoResource);
|
|
||||||
ExReleaseResourceLite(&Fcb->MainResource);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Rebrowse the FCB in order to free them now */
|
/* Rebrowse the FCB in order to free them now */
|
||||||
while (!IsListEmpty(&DeviceExt->FcbListHead))
|
while (!IsListEmpty(&DeviceExt->FcbListHead))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue