forget update de.rc
[reactos.git] / reactos / ntoskrnl / cc / fs.c
index 7d3d3d8..be97a98 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef VACB_MAPPING_GRANULARITY
 #define VACB_MAPPING_GRANULARITY (256 * 1024)
 #endif
+
 /* GLOBALS   *****************************************************************/
 
 extern FAST_MUTEX ViewLock;
@@ -39,9 +39,8 @@ CcGetDirtyPages (
        IN      PVOID                   Context2
        )
 {
+       LARGE_INTEGER i;
        UNIMPLEMENTED;
-
-       LARGE_INTEGER i; 
        i.QuadPart = 0;
        return i;
 }
@@ -69,9 +68,8 @@ CcGetLsnForFileObject (
        OUT     PLARGE_INTEGER  OldestLsn OPTIONAL
        )
 {
+       LARGE_INTEGER i;
        UNIMPLEMENTED;
-
-       LARGE_INTEGER i; 
        i.QuadPart = 0;
        return i;
 }
@@ -136,7 +134,7 @@ CcSetFileSizes (IN PFILE_OBJECT FileObject,
   LIST_ENTRY FreeListHead;
   NTSTATUS Status;
 
-  DPRINT("CcSetFileSizes(FileObject %x, FileSizes %x)\n", 
+  DPRINT("CcSetFileSizes(FileObject 0x%p, FileSizes 0x%p)\n",
         FileObject, FileSizes);
   DPRINT("AllocationSize %d, FileSize %d, ValidDataLength %d\n",
          (ULONG)FileSizes->AllocationSize.QuadPart,
@@ -151,11 +149,11 @@ CcSetFileSizes (IN PFILE_OBJECT FileObject,
    */
   if (Bcb == NULL)
      return;
+
   if (FileSizes->AllocationSize.QuadPart < Bcb->AllocationSize.QuadPart)
   {
      InitializeListHead(&FreeListHead);
-     ExAcquireFastMutex(&ViewLock);
+     ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&ViewLock);
      KeAcquireSpinLock(&Bcb->BcbLock, &oldirql);
 
      current_entry = Bcb->BcbSegmentListHead.Flink;
@@ -184,11 +182,11 @@ CcSetFileSizes (IN PFILE_OBJECT FileObject,
           }
        }
      }
-     
+
      Bcb->AllocationSize = FileSizes->AllocationSize;
      Bcb->FileSize = FileSizes->FileSize;
      KeReleaseSpinLock(&Bcb->BcbLock, oldirql);
-     ExReleaseFastMutex(&ViewLock);
+     ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&ViewLock);
 
      current_entry = FreeListHead.Flink;
      while(current_entry != &FreeListHead)
@@ -198,7 +196,7 @@ CcSetFileSizes (IN PFILE_OBJECT FileObject,
         Status = CcRosInternalFreeCacheSegment(current);
         if (!NT_SUCCESS(Status))
         {
-           DPRINT1("CcRosInternalFreeCacheSegment failed, status = %x\n");
+           DPRINT1("CcRosInternalFreeCacheSegment failed, status = %x\n", Status);
           KEBUGCHECK(0);
         }
      }