[NTOSKRNL] In CcFlushCache(), release the VACB using CcRosReleaseVacb()
authorPierre Schweitzer <pierre@reactos.org>
Sun, 18 Mar 2018 12:11:05 +0000 (13:11 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 18 Mar 2018 12:21:54 +0000 (13:21 +0100)
Instead of reimplementing it partially and wrongly.

CORE-14481
CORE-14480
CORE-14482

ntoskrnl/cc/view.c

index 4651abe..24be8cb 100644 (file)
@@ -963,7 +963,6 @@ CcFlushCache (
     LONGLONG RemainingLength;
     PROS_VACB current;
     NTSTATUS Status;
-    KIRQL oldIrql;
 
     CCTRACE(CC_API_DEBUG, "SectionObjectPointers=%p FileOffset=%p Length=%lu\n",
         SectionObjectPointers, FileOffset, Length);
@@ -1006,13 +1005,7 @@ CcFlushCache (
                     }
                 }
 
-                CcRosReleaseVacbLock(current);
-
-                KeAcquireGuardedMutex(&ViewLock);
-                KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);
-                CcRosVacbDecRefCount(current);
-                KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
-                KeReleaseGuardedMutex(&ViewLock);
+                CcRosReleaseVacb(SharedCacheMap, current, current->Valid, current->Dirty, FALSE);
             }
 
             Offset.QuadPart += VACB_MAPPING_GRANULARITY;