[NTOSKRNL::CC]Implement CcRescheduleLazyWriteScan CcSetLazyWriteScanQueued
These two function Rescheduling and Scheduling Lazy write scan
This commit is contained in:
parent
104a0212e0
commit
1c173364a1
@ -13,8 +13,42 @@
|
||||
|
||||
extern "C"
|
||||
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
CcSetLazyWriteScanQueued(
|
||||
IN ULONG FlushReason,
|
||||
IN BOOLEAN QueuedState)
|
||||
{
|
||||
switch (FlushReason)
|
||||
{
|
||||
case 1:
|
||||
LazyWriter.PendingLowMemoryScan = QueuedState;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
LazyWriter.PendingPowerScan = QueuedState;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
LazyWriter.PendingPeriodicScan = QueuedState;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
LazyWriter.PendingTeardownScan = QueuedState;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
LazyWriter.PendingCoalescingFlushScan = QueuedState;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
FASTCALL
|
||||
VECTORCALL
|
||||
CcIsLazyWriteScanQueued(
|
||||
_In_ ULONG ReasonForFlush
|
||||
)
|
||||
@ -150,6 +184,33 @@ CcQueueLazyWriteScanThread(
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
CcRescheduleLazyWriteScan( IN PLARGE_INTEGER NextScanDelay)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(NextScanDelay);
|
||||
LARGE_INTEGER Delay = {0};
|
||||
|
||||
if (LazyWriter.ScanActive)
|
||||
{
|
||||
|
||||
if (NextScanDelay && NextScanDelay->QuadPart != 0x7FFFFFFFFFFFFFFF && NextScanDelay->QuadPart != 0)
|
||||
{
|
||||
Delay.QuadPart = NextScanDelay->QuadPart * KeMaximumIncrement;
|
||||
if (Delay.QuadPart > 160000000)
|
||||
Delay.QuadPart = 160000000;
|
||||
if(Delay.QuadPart < 10000000 )
|
||||
Delay = CcIdleDelay;
|
||||
}
|
||||
KeSetCoalescableTimer(&LazyWriter.ScanTimer,CcIdleDelay,0,1000,&LazyWriter.ScanDpc);
|
||||
}
|
||||
else
|
||||
{
|
||||
CcScheduleLazyWriteScan(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
CcComputeNextScanTime(PLARGE_INTEGER OldestTICKTIMEForMetadata, PLARGE_INTEGER NextScanDelay)
|
||||
|
Loading…
Reference in New Issue
Block a user