- Marked a cache segment as page out in progress to prevent from

recursive calls to MmPageOutPhysicalAddress.
- This fixes bug #220.

svn path=/trunk/; revision=8403
This commit is contained in:
Hartmut Birr 2004-02-26 19:29:55 +00:00
parent 8098620a78
commit d96346dede
2 changed files with 8 additions and 3 deletions

View file

@ -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 @@ CcRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed)
}
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 @@ CcRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed)
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 @@ CcRosCreateCacheSegment(PBCB Bcb,
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;

View file

@ -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 @@ typedef struct _CACHE_SEGMENT
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;