* 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
}
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(¤t->Bcb->BcbLock, oldIrql);
ExReleaseFastMutex(&ViewLock);
for (i = 0; i < current->Bcb->CacheSegmentSize / PAGE_SIZE; i++)
ExAcquireFastMutex(&ViewLock);
KeAcquireSpinLock(¤t->Bcb->BcbLock, &oldIrql);
current->ReferenceCount--;
+ current->PageOut = FALSE;
KeReleaseSpinLock(¤t->Bcb->BcbLock, oldIrql);
current_entry = ¤t->CacheSegmentLRUListEntry;
continue;
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;
#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>
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;