https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0518444217452c18d6c8c…
commit 0518444217452c18d6c8c369852e7b0c17990d63
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Fri Feb 9 11:13:53 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Fri Feb 9 11:13:53 2018 +0100
[NTOSKRNL] Drop the iSharedCacheMapLock in favor of the master lock
---
ntoskrnl/cc/view.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/ntoskrnl/cc/view.c b/ntoskrnl/cc/view.c
index cb6991b19c..23bc5076e1 100644
--- a/ntoskrnl/cc/view.c
+++ b/ntoskrnl/cc/view.c
@@ -64,11 +64,6 @@ LIST_ENTRY CcDeferredWrites;
KSPIN_LOCK CcDeferredWriteSpinLock;
LIST_ENTRY CcCleanSharedCacheMapList;
-/* Internal vars (ROS):
- * - Lock for the CcCleanSharedCacheMapList list
- */
-KSPIN_LOCK iSharedCacheMapLock;
-
#if DBG
static void CcRosVacbIncRefCount_(PROS_VACB vacb, const char* file, int line)
{
@@ -1100,9 +1095,9 @@ CcRosDeleteFileCache (
CcRosInternalFreeVacb(current);
}
- KeAcquireSpinLock(&iSharedCacheMapLock, &OldIrql);
+ OldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);
RemoveEntryList(&SharedCacheMap->SharedCacheMapLinks);
- KeReleaseSpinLock(&iSharedCacheMapLock, OldIrql);
+ KeReleaseQueuedSpinLock(LockQueueMasterLock, OldIrql);
ExFreeToNPagedLookasideList(&SharedCacheMapLookasideList, SharedCacheMap);
KeAcquireGuardedMutex(&ViewLock);
@@ -1267,9 +1262,9 @@ CcRosInitializeFileCache (
InitializeListHead(&SharedCacheMap->CacheMapVacbListHead);
FileObject->SectionObjectPointer->SharedCacheMap = SharedCacheMap;
- KeAcquireSpinLock(&iSharedCacheMapLock, &OldIrql);
+ OldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);
InsertTailList(&CcCleanSharedCacheMapList,
&SharedCacheMap->SharedCacheMapLinks);
- KeReleaseSpinLock(&iSharedCacheMapLock, OldIrql);
+ KeReleaseQueuedSpinLock(LockQueueMasterLock, OldIrql);
}
if (FileObject->PrivateCacheMap == NULL)
{
@@ -1282,9 +1277,9 @@ CcRosInitializeFileCache (
/* If we also allocated the shared cache map for this file, kill it */
if (Allocated)
{
- KeAcquireSpinLock(&iSharedCacheMapLock, &OldIrql);
+ OldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);
RemoveEntryList(&SharedCacheMap->SharedCacheMapLinks);
- KeReleaseSpinLock(&iSharedCacheMapLock, OldIrql);
+ KeReleaseQueuedSpinLock(LockQueueMasterLock, OldIrql);
FileObject->SectionObjectPointer->SharedCacheMap = NULL;
ObDereferenceObject(FileObject);
@@ -1349,7 +1344,6 @@ CcInitView (
InitializeListHead(&CcDeferredWrites);
InitializeListHead(&CcCleanSharedCacheMapList);
KeInitializeSpinLock(&CcDeferredWriteSpinLock);
- KeInitializeSpinLock(&iSharedCacheMapLock);
KeInitializeGuardedMutex(&ViewLock);
ExInitializeNPagedLookasideList(&iBcbLookasideList,
NULL,