https://git.reactos.org/?p=reactos.git;a=commitdiff;h=323f71a5519858222d749…
commit 323f71a5519858222d74917a0478de843e5d10d3
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Wed Feb 7 21:35:22 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Wed Feb 7 21:37:17 2018 +0100
[NTOSKRNL] Use the LockQueueMasterLock where appropriate
---
ntoskrnl/cc/copy.c | 5 ++++-
ntoskrnl/cc/lazywrite.c | 4 +++-
ntoskrnl/cc/view.c | 4 +++-
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/ntoskrnl/cc/copy.c b/ntoskrnl/cc/copy.c
index 7a84e23fb9..521d90b48e 100644
--- a/ntoskrnl/cc/copy.c
+++ b/ntoskrnl/cc/copy.c
@@ -628,6 +628,7 @@ CcDeferWrite (
IN ULONG BytesToWrite,
IN BOOLEAN Retrying)
{
+ KIRQL OldIrql;
PDEFERRED_WRITE Context;
PFSRTL_COMMON_FCB_HEADER Fcb;
@@ -675,11 +676,13 @@ CcDeferWrite (
/* Try to execute the posted writes */
CcPostDeferredWrites();
- /* FIXME: lock master */
+ /* Schedule a lazy writer run to handle deferred writes */
+ OldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);
if (!LazyWriter.ScanActive)
{
CcScheduleLazyWriteScan(FALSE);
}
+ KeReleaseQueuedSpinLock(LockQueueMasterLock, OldIrql);
}
/*
diff --git a/ntoskrnl/cc/lazywrite.c b/ntoskrnl/cc/lazywrite.c
index 4619aa8c69..292266d191 100644
--- a/ntoskrnl/cc/lazywrite.c
+++ b/ntoskrnl/cc/lazywrite.c
@@ -119,7 +119,6 @@ CcScanDpc(
CcPostWorkQueue(WorkItem, &CcRegularWorkQueue);
}
-/* FIXME: handle master lock */
VOID
CcLazyWriteScan(VOID)
{
@@ -165,6 +164,7 @@ CcLazyWriteScan(VOID)
CcPostDeferredWrites();
}
+ /* Post items that were due for end of run */
while (!IsListEmpty(&ToPost))
{
ListEntry = RemoveHeadList(&ToPost);
@@ -173,7 +173,9 @@ CcLazyWriteScan(VOID)
}
/* We're no longer active */
+ OldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);
LazyWriter.ScanActive = FALSE;
+ KeReleaseQueuedSpinLock(LockQueueMasterLock, OldIrql);
}
VOID CcScheduleLazyWriteScan(
diff --git a/ntoskrnl/cc/view.c b/ntoskrnl/cc/view.c
index e050a33c17..2e8fb6c51e 100644
--- a/ntoskrnl/cc/view.c
+++ b/ntoskrnl/cc/view.c
@@ -520,11 +520,13 @@ CcRosMarkDirtyVacb (
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
KeReleaseGuardedMutex(&ViewLock);
- /* FIXME: lock master */
+ /* Schedule a lazy writer run to now that we have dirty VACB */
+ oldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);
if (!LazyWriter.ScanActive)
{
CcScheduleLazyWriteScan(FALSE);
}
+ KeReleaseQueuedSpinLock(LockQueueMasterLock, oldIrql);
}
VOID