mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[NTOSKRNL] When marking a BCB dirty, also mark the underlying VACB dirty.
Experiment and MSDN tend to show that a dirty BCB is queued for lazy write. This will do the job here! Also, renamed CcRosMarkDirtyFile() which is more accurate, and added a new function CcRosMarkDirtyVacb() which just takes a VACB as arg (expected locked) and marks it dirty (using previous implementation). Make CcRosMarkDirtyFile() use it. CORE-14235
This commit is contained in:
parent
6ba67b8152
commit
07e6e9c9c1
4 changed files with 37 additions and 17 deletions
|
@ -247,6 +247,7 @@ CcSetDirtyPinnedData (
|
||||||
Bcb, Lsn);
|
Bcb, Lsn);
|
||||||
|
|
||||||
iBcb->Dirty = TRUE;
|
iBcb->Dirty = TRUE;
|
||||||
|
CcRosMarkDirtyVacb(iBcb->Vacb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -565,25 +565,15 @@ CcRosLookupVacb (
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
CcRosMarkDirtyVacb (
|
CcRosMarkDirtyVacb (
|
||||||
PROS_SHARED_CACHE_MAP SharedCacheMap,
|
PROS_VACB Vacb)
|
||||||
LONGLONG FileOffset)
|
|
||||||
{
|
{
|
||||||
PROS_VACB Vacb;
|
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
|
PROS_SHARED_CACHE_MAP SharedCacheMap;
|
||||||
|
|
||||||
ASSERT(SharedCacheMap);
|
SharedCacheMap = Vacb->SharedCacheMap;
|
||||||
|
|
||||||
DPRINT("CcRosMarkDirtyVacb(SharedCacheMap 0x%p, FileOffset %I64u)\n",
|
|
||||||
SharedCacheMap, FileOffset);
|
|
||||||
|
|
||||||
Vacb = CcRosLookupVacb(SharedCacheMap, FileOffset);
|
|
||||||
if (Vacb == NULL)
|
|
||||||
{
|
|
||||||
KeBugCheck(CACHE_MANAGER);
|
|
||||||
}
|
|
||||||
|
|
||||||
KeAcquireGuardedMutex(&ViewLock);
|
KeAcquireGuardedMutex(&ViewLock);
|
||||||
KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);
|
KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);
|
||||||
|
@ -606,6 +596,30 @@ CcRosMarkDirtyVacb (
|
||||||
|
|
||||||
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
|
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
|
||||||
KeReleaseGuardedMutex(&ViewLock);
|
KeReleaseGuardedMutex(&ViewLock);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
CcRosMarkDirtyFile (
|
||||||
|
PROS_SHARED_CACHE_MAP SharedCacheMap,
|
||||||
|
LONGLONG FileOffset)
|
||||||
|
{
|
||||||
|
PROS_VACB Vacb;
|
||||||
|
|
||||||
|
ASSERT(SharedCacheMap);
|
||||||
|
|
||||||
|
DPRINT("CcRosMarkDirtyVacb(SharedCacheMap 0x%p, FileOffset %I64u)\n",
|
||||||
|
SharedCacheMap, FileOffset);
|
||||||
|
|
||||||
|
Vacb = CcRosLookupVacb(SharedCacheMap, FileOffset);
|
||||||
|
if (Vacb == NULL)
|
||||||
|
{
|
||||||
|
KeBugCheck(CACHE_MANAGER);
|
||||||
|
}
|
||||||
|
|
||||||
|
CcRosMarkDirtyVacb(Vacb);
|
||||||
|
|
||||||
|
|
||||||
CcRosReleaseVacbLock(Vacb);
|
CcRosReleaseVacbLock(Vacb);
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
|
@ -281,11 +281,16 @@ CcInitCacheZeroPage(VOID);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
CcRosMarkDirtyVacb(
|
CcRosMarkDirtyFile(
|
||||||
PROS_SHARED_CACHE_MAP SharedCacheMap,
|
PROS_SHARED_CACHE_MAP SharedCacheMap,
|
||||||
LONGLONG FileOffset
|
LONGLONG FileOffset
|
||||||
);
|
);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
CcRosMarkDirtyVacb(
|
||||||
|
PROS_VACB Vacb);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
CcRosFlushDirtyPages(
|
CcRosFlushDirtyPages(
|
||||||
|
|
|
@ -2374,7 +2374,7 @@ MmWritePageSectionView(PMMSUPPORT AddressSpace,
|
||||||
ASSERT(SwapEntry == 0);
|
ASSERT(SwapEntry == 0);
|
||||||
//SOffset.QuadPart = Offset.QuadPart + Segment->Image.FileOffset;
|
//SOffset.QuadPart = Offset.QuadPart + Segment->Image.FileOffset;
|
||||||
#ifndef NEWCC
|
#ifndef NEWCC
|
||||||
CcRosMarkDirtyVacb(SharedCacheMap, Offset.QuadPart);
|
CcRosMarkDirtyFile(SharedCacheMap, Offset.QuadPart);
|
||||||
#endif
|
#endif
|
||||||
MmLockSectionSegment(Segment);
|
MmLockSectionSegment(Segment);
|
||||||
MmSetPageEntrySectionSegment(Segment, &Offset, PageEntry);
|
MmSetPageEntrySectionSegment(Segment, &Offset, PageEntry);
|
||||||
|
@ -4006,7 +4006,7 @@ MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
|
||||||
#ifndef NEWCC
|
#ifndef NEWCC
|
||||||
FileObject = MemoryArea->Data.SectionData.Section->FileObject;
|
FileObject = MemoryArea->Data.SectionData.Section->FileObject;
|
||||||
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
|
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
|
||||||
CcRosMarkDirtyVacb(SharedCacheMap, Offset.QuadPart + Segment->Image.FileOffset);
|
CcRosMarkDirtyFile(SharedCacheMap, Offset.QuadPart + Segment->Image.FileOffset);
|
||||||
#endif
|
#endif
|
||||||
ASSERT(SwapEntry == 0);
|
ASSERT(SwapEntry == 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue