Commit in reactos/ntoskrnl on MAIN
include/internal/cc.h+3-11.18 -> 1.19
cc/view.c+5-21.71 -> 1.72
+8-3
2 modified files
- Marked a cache segment as page out in progress to prevent from 
  recursive calls to MmPageOutPhysicalAddress. 
- This fixes bug #220.

reactos/ntoskrnl/include/internal
cc.h 1.18 -> 1.19
diff -u -r1.18 -r1.19
--- cc.h	27 Jun 2003 21:28:30 -0000	1.18
+++ cc.h	26 Feb 2004 19:29:55 -0000	1.19
@@ -1,6 +1,6 @@
 #ifndef __INCLUDE_INTERNAL_CC_H
 #define __INCLUDE_INTERNAL_CC_H
-/* $Id: cc.h,v 1.18 2003/06/27 21:28:30 hbirr Exp $ */
+/* $Id: cc.h,v 1.19 2004/02/26 19:29:55 hbirr Exp $ */
 #include <ddk/ntifs.h>
 
 
@@ -31,6 +31,8 @@
   BOOLEAN Valid;
   /* Are the contents of the cache segment data newer than those on disk. */
   BOOLEAN Dirty;
+  /* Page out in progress */ 
+  BOOLEAN PageOut;
   ULONG MappedCount;
   /* Entry in the list of segments for this BCB. */
   LIST_ENTRY BcbSegmentListEntry;

reactos/ntoskrnl/cc
view.c 1.71 -> 1.72
diff -u -r1.71 -r1.72
--- view.c	31 Dec 2003 05:33:03 -0000	1.71
+++ view.c	26 Feb 2004 19:29:55 -0000	1.72
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: view.c,v 1.71 2003/12/31 05:33:03 jfilby Exp $
+/* $Id: view.c,v 1.72 2004/02/26 19:29:55 hbirr Exp $
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/cc/view.c
@@ -270,13 +270,14 @@
       }
       else
       {
-         if (last != current && current->MappedCount > 0 && !current->Dirty)
+         if (last != current && current->MappedCount > 0 && !current->Dirty && !current->PageOut)
 	   {
 	     ULONG i;
 	     NTSTATUS Status;
 	        
              current->ReferenceCount++;
 	     last = current;
+	     current->PageOut = TRUE;
              KeReleaseSpinLock(&current->Bcb->BcbLock, oldIrql);
 	     ExReleaseFastMutex(&ViewLock);
 	     for (i = 0; i < current->Bcb->CacheSegmentSize / PAGE_SIZE; i++)
@@ -292,6 +293,7 @@
              ExAcquireFastMutex(&ViewLock);
              KeAcquireSpinLock(&current->Bcb->BcbLock, &oldIrql);
 	     current->ReferenceCount--;
+	     current->PageOut = FALSE;
              KeReleaseSpinLock(&current->Bcb->BcbLock, oldIrql);
              current_entry = &current->CacheSegmentLRUListEntry;
 	     continue;
@@ -505,6 +507,7 @@
   current = ExAllocateFromNPagedLookasideList(&CacheSegLookasideList);
   current->Valid = FALSE;
   current->Dirty = FALSE;
+  current->PageOut = FALSE;
   current->FileOffset = ROUND_DOWN(FileOffset, Bcb->CacheSegmentSize);
   current->Bcb = Bcb;
   current->MappedCount = 0;
CVSspam 0.2.8