InsertTailList(&DirtySegmentListHead, &CacheSeg->DirtySegmentListEntry);
DirtyPageCount += Bcb->CacheSegmentSize / PAGE_SIZE;
}
- RemoveEntryList(&CacheSeg->CacheSegmentLRUListEntry);
- InsertTailList(&CacheSegmentLRUListHead, &CacheSeg->CacheSegmentLRUListEntry);
if (Mapped)
{
KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
}
+ KeAcquireGuardedMutex(&ViewLock);
+
+ /* Move to the tail of the LRU list */
+ RemoveEntryList(&CacheSeg->CacheSegmentLRUListEntry);
+ InsertTailList(&CacheSegmentLRUListHead, &CacheSeg->CacheSegmentLRUListEntry);
+
+ KeReleaseGuardedMutex(&ViewLock);
CacheSeg->Dirty = TRUE;
ExReleasePushLock(&CacheSeg->Lock);
current = CcRosLookupCacheSegment(Bcb, CurrentOffset);
if (current != NULL)
{
+ KeAcquireGuardedMutex(&ViewLock);
+
+ /* Move to tail of LRU list */
+ RemoveEntryList(¤t->CacheSegmentLRUListEntry);
+ InsertTailList(&CacheSegmentLRUListHead, ¤t->CacheSegmentLRUListEntry);
+
+ KeReleaseGuardedMutex(&ViewLock);
+
CacheSegList[i] = current;
}
else
return Status;
}
}
+
+ KeAcquireGuardedMutex(&ViewLock);
+
+ /* Move to the tail of the LRU list */
+ RemoveEntryList(¤t->CacheSegmentLRUListEntry);
+ InsertTailList(&CacheSegmentLRUListHead, ¤t->CacheSegmentLRUListEntry);
+
+ KeReleaseGuardedMutex(&ViewLock);
+
/*
* Return information about the segment to the caller.
*/