mirror of
https://github.com/reactos/reactos.git
synced 2025-05-22 02:25:18 +00:00
Lock the MainResource from fcb, if we are trying to write back a modified cache segment.
Usually we have to call the callback function from FSD. svn path=/trunk/; revision=19691
This commit is contained in:
parent
0c068e7775
commit
30321765c2
1 changed files with 14 additions and 1 deletions
|
@ -244,21 +244,34 @@ CcRosFlushDirtyPages(ULONG Target, PULONG Count)
|
||||||
current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT,
|
current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT,
|
||||||
DirtySegmentListEntry);
|
DirtySegmentListEntry);
|
||||||
current_entry = current_entry->Flink;
|
current_entry = current_entry->Flink;
|
||||||
|
|
||||||
|
// Locked = current->Bcb->Callbacks.AcquireForLazyWrite(current->Bcb->Context, FALSE);
|
||||||
|
Locked = ExTryToAcquireResourceExclusiveLite(((FSRTL_COMMON_FCB_HEADER*)(current->Bcb->FileObject->FsContext))->Resource);
|
||||||
|
if (!Locked)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Locked = CcTryToAcquireBrokenMutex(¤t->Lock);
|
Locked = CcTryToAcquireBrokenMutex(¤t->Lock);
|
||||||
if (!Locked)
|
if (!Locked)
|
||||||
{
|
{
|
||||||
|
// current->Bcb->Callbacks.ReleaseFromLazyWrite(current->Bcb->Context);
|
||||||
|
ExReleaseResourceLite(((FSRTL_COMMON_FCB_HEADER*)(current->Bcb->FileObject->FsContext))->Resource);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ASSERT(current->Dirty);
|
ASSERT(current->Dirty);
|
||||||
if (current->ReferenceCount > 1)
|
if (current->ReferenceCount > 1)
|
||||||
{
|
{
|
||||||
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(¤t->Lock);
|
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(¤t->Lock);
|
||||||
|
// current->Bcb->Callbacks.ReleaseFromLazyWrite(current->Bcb->Context);
|
||||||
|
ExReleaseResourceLite(((FSRTL_COMMON_FCB_HEADER*)(current->Bcb->FileObject->FsContext))->Resource);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&ViewLock);
|
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&ViewLock);
|
||||||
PagesPerSegment = current->Bcb->CacheSegmentSize / PAGE_SIZE;
|
PagesPerSegment = current->Bcb->CacheSegmentSize / PAGE_SIZE;
|
||||||
Status = CcRosFlushCacheSegment(current);
|
Status = CcRosFlushCacheSegment(current);
|
||||||
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(¤t->Lock);
|
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(¤t->Lock);
|
||||||
|
// current->Bcb->Callbacks.ReleaseFromLazyWrite(current->Bcb->Context);
|
||||||
|
ExReleaseResourceLite(((FSRTL_COMMON_FCB_HEADER*)(current->Bcb->FileObject->FsContext))->Resource);
|
||||||
if (!NT_SUCCESS(Status) && (Status != STATUS_END_OF_FILE))
|
if (!NT_SUCCESS(Status) && (Status != STATUS_END_OF_FILE))
|
||||||
{
|
{
|
||||||
DPRINT1("CC: Failed to flush cache segment.\n");
|
DPRINT1("CC: Failed to flush cache segment.\n");
|
||||||
|
|
Loading…
Reference in a new issue