mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:12:56 +00:00
[NTOS:CC] Always honor WriteThrough parameter in CcUnpinRepinnedBcb
This commit is contained in:
parent
1505abbc09
commit
358d06c47c
1 changed files with 13 additions and 17 deletions
|
@ -629,29 +629,25 @@ CcUnpinRepinnedBcb (
|
||||||
SharedCacheMap = iBcb->Vacb->SharedCacheMap;
|
SharedCacheMap = iBcb->Vacb->SharedCacheMap;
|
||||||
IoStatus->Status = STATUS_SUCCESS;
|
IoStatus->Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
if (WriteThrough)
|
||||||
|
{
|
||||||
|
CcFlushCache(iBcb->Vacb->SharedCacheMap->FileObject->SectionObjectPointer,
|
||||||
|
&iBcb->PFCB.MappedFileOffset,
|
||||||
|
iBcb->PFCB.MappedLength,
|
||||||
|
IoStatus);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IoStatus->Status = STATUS_SUCCESS;
|
||||||
|
IoStatus->Information = 0;
|
||||||
|
}
|
||||||
|
|
||||||
KeAcquireSpinLock(&SharedCacheMap->BcbSpinLock, &OldIrql);
|
KeAcquireSpinLock(&SharedCacheMap->BcbSpinLock, &OldIrql);
|
||||||
if (--iBcb->RefCount == 0)
|
if (--iBcb->RefCount == 0)
|
||||||
{
|
{
|
||||||
RemoveEntryList(&iBcb->BcbEntry);
|
RemoveEntryList(&iBcb->BcbEntry);
|
||||||
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
||||||
|
|
||||||
IoStatus->Information = 0;
|
|
||||||
if (WriteThrough)
|
|
||||||
{
|
|
||||||
if (iBcb->Vacb->Dirty)
|
|
||||||
{
|
|
||||||
IoStatus->Status = CcRosFlushVacb(iBcb->Vacb);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
IoStatus->Status = STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
IoStatus->Status = STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (iBcb->PinCount != 0)
|
if (iBcb->PinCount != 0)
|
||||||
{
|
{
|
||||||
ExReleaseResourceLite(&iBcb->Lock);
|
ExReleaseResourceLite(&iBcb->Lock);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue