mirror of
https://github.com/reactos/reactos.git
synced 2024-11-23 19:43:31 +08:00
[NTOS] Loop again and again until the whole cache is empty when sutting down
This commit is contained in:
parent
addf824d87
commit
347a4f146b
@ -212,6 +212,7 @@ CcRosFlushDirtyPages (
|
||||
BOOLEAN Locked;
|
||||
NTSTATUS Status;
|
||||
KIRQL OldIrql;
|
||||
BOOLEAN FlushAll = (Target == MAXULONG);
|
||||
|
||||
DPRINT("CcRosFlushDirtyPages(Target %lu)\n", Target);
|
||||
|
||||
@ -226,8 +227,16 @@ CcRosFlushDirtyPages (
|
||||
DPRINT("No Dirty pages\n");
|
||||
}
|
||||
|
||||
while ((current_entry != &DirtyVacbListHead) && (Target > 0))
|
||||
while (((current_entry != &DirtyVacbListHead) && (Target > 0)) || FlushAll)
|
||||
{
|
||||
if (current_entry == &DirtyVacbListHead)
|
||||
{
|
||||
ASSERT(FlushAll);
|
||||
if (IsListEmpty(&DirtyVacbListHead))
|
||||
break;
|
||||
current_entry = DirtyVacbListHead.Flink;
|
||||
}
|
||||
|
||||
current = CONTAINING_RECORD(current_entry,
|
||||
ROS_VACB,
|
||||
DirtyVacbListEntry);
|
||||
|
@ -1075,7 +1075,7 @@ NtSetSystemPowerState(IN POWER_ACTION SystemAction,
|
||||
#ifndef NEWCC
|
||||
/* Flush dirty cache pages */
|
||||
/* XXX: Is that still mandatory? As now we'll wait on lazy writer to complete? */
|
||||
CcRosFlushDirtyPages(-1, &Dummy, TRUE, FALSE); //HACK: We really should wait here!
|
||||
CcRosFlushDirtyPages(MAXULONG, &Dummy, TRUE, FALSE); //HACK: We really should wait here!
|
||||
#else
|
||||
Dummy = 0;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user