[NTOS:CC]
[reactos.git] / reactos / ntoskrnl / cc / pin.c
index 3779f64..9159745 100644 (file)
@@ -187,7 +187,7 @@ CcPinRead (
             iBcb->Pinned = TRUE;
             if (InterlockedIncrement(&iBcb->Vacb->PinCount) == 1)
             {
-                KeReleaseMutex(&iBcb->Vacb->Mutex, FALSE);
+                CcRosReleaseVacbLock(iBcb->Vacb);
             }
 
             if (Flags & PIN_EXCLUSIVE)
@@ -283,11 +283,7 @@ CcUnpinDataForThread (
         iBcb->Pinned = FALSE;
         if (InterlockedDecrement(&iBcb->Vacb->PinCount) == 0)
         {
-            KeWaitForSingleObject(&iBcb->Vacb->Mutex,
-                                  Executive,
-                                  KernelMode,
-                                  FALSE,
-                                  NULL);
+            CcRosAcquireVacbLock(iBcb->Vacb, NULL);
         }
     }
 
@@ -339,11 +335,7 @@ CcUnpinRepinnedBcb (
         IoStatus->Information = 0;
         if (WriteThrough)
         {
-            KeWaitForSingleObject(&iBcb->Vacb->Mutex,
-                                  Executive,
-                                  KernelMode,
-                                  FALSE,
-                                  NULL);
+            CcRosAcquireVacbLock(iBcb->Vacb, NULL);
             if (iBcb->Vacb->Dirty)
             {
                 IoStatus->Status = CcRosFlushVacb(iBcb->Vacb);
@@ -352,7 +344,7 @@ CcUnpinRepinnedBcb (
             {
                 IoStatus->Status = STATUS_SUCCESS;
             }
-            KeReleaseMutex(&iBcb->Vacb->Mutex, FALSE);
+            CcRosReleaseVacbLock(iBcb->Vacb);
         }
         else
         {
@@ -365,11 +357,7 @@ CcUnpinRepinnedBcb (
             iBcb->Pinned = FALSE;
             if (InterlockedDecrement(&iBcb->Vacb->PinCount) == 0)
             {
-                KeWaitForSingleObject(&iBcb->Vacb->Mutex,
-                                      Executive,
-                                      KernelMode,
-                                      FALSE,
-                                      NULL);
+                CcRosAcquireVacbLock(iBcb->Vacb, NULL);
             }
         }
         ExDeleteResourceLite(&iBcb->Lock);