From 467aa6f5859d2b11cc3aba15a1fabcd22672523e Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 12 Apr 2014 10:37:08 +0000 Subject: [PATCH] [NTOS:CC] - Remove remnants of long-unused delayed remove/close feature (added in r3970, removed in r39663) svn path=/trunk/; revision=62711 --- reactos/ntoskrnl/cc/view.c | 42 +++----------------------- reactos/ntoskrnl/include/internal/cc.h | 4 +-- reactos/ntoskrnl/mm/section.c | 2 +- 3 files changed, 7 insertions(+), 41 deletions(-) diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index c3eeae0ee14..146659d67fb 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -44,7 +44,6 @@ static LIST_ENTRY DirtyVacbListHead; static LIST_ENTRY VacbListHead; static LIST_ENTRY VacbLruListHead; -static LIST_ENTRY ClosedListHead; ULONG DirtyPageCount = 0; KGUARDED_MUTEX ViewLock; @@ -1026,12 +1025,6 @@ CcRosDeleteFileCache ( Bcb->RefCount--; if (Bcb->RefCount == 0) { - if (Bcb->BcbRemoveListEntry.Flink != NULL) - { - RemoveEntryList(&Bcb->BcbRemoveListEntry); - Bcb->BcbRemoveListEntry.Flink = NULL; - } - FileObject->SectionObjectPointer->SharedCacheMap = NULL; /* @@ -1082,37 +1075,23 @@ CcRosReferenceCache ( KeAcquireGuardedMutex(&ViewLock); Bcb = (PBCB)FileObject->SectionObjectPointer->SharedCacheMap; ASSERT(Bcb); - if (Bcb->RefCount == 0) - { - ASSERT(Bcb->BcbRemoveListEntry.Flink != NULL); - RemoveEntryList(&Bcb->BcbRemoveListEntry); - Bcb->BcbRemoveListEntry.Flink = NULL; - - } - else - { - ASSERT(Bcb->BcbRemoveListEntry.Flink == NULL); - } + ASSERT(Bcb->RefCount != 0); Bcb->RefCount++; KeReleaseGuardedMutex(&ViewLock); } VOID NTAPI -CcRosSetRemoveOnClose ( +CcRosRemoveIfClosed ( PSECTION_OBJECT_POINTERS SectionObjectPointer) { PBCB Bcb; - DPRINT("CcRosSetRemoveOnClose()\n"); + DPRINT("CcRosRemoveIfClosed()\n"); KeAcquireGuardedMutex(&ViewLock); Bcb = (PBCB)SectionObjectPointer->SharedCacheMap; - if (Bcb) + if (Bcb && Bcb->RefCount == 0) { - Bcb->RemoveOnClose = TRUE; - if (Bcb->RefCount == 0) - { - CcRosDeleteFileCache(Bcb->FileObject, Bcb); - } + CcRosDeleteFileCache(Bcb->FileObject, Bcb); } KeReleaseGuardedMutex(&ViewLock); } @@ -1196,11 +1175,6 @@ CcTryToInitializeFileCache ( FileObject->PrivateCacheMap = Bcb; Bcb->RefCount++; } - if (Bcb->BcbRemoveListEntry.Flink != NULL) - { - RemoveEntryList(&Bcb->BcbRemoveListEntry); - Bcb->BcbRemoveListEntry.Flink = NULL; - } Status = STATUS_SUCCESS; } KeReleaseGuardedMutex(&ViewLock); @@ -1258,11 +1232,6 @@ CcRosInitializeFileCache ( FileObject->PrivateCacheMap = Bcb; Bcb->RefCount++; } - if (Bcb->BcbRemoveListEntry.Flink != NULL) - { - RemoveEntryList(&Bcb->BcbRemoveListEntry); - Bcb->BcbRemoveListEntry.Flink = NULL; - } KeReleaseGuardedMutex(&ViewLock); return STATUS_SUCCESS; @@ -1297,7 +1266,6 @@ CcInitView ( InitializeListHead(&VacbListHead); InitializeListHead(&DirtyVacbListHead); InitializeListHead(&VacbLruListHead); - InitializeListHead(&ClosedListHead); KeInitializeGuardedMutex(&ViewLock); ExInitializeNPagedLookasideList (&iBcbLookasideList, NULL, diff --git a/reactos/ntoskrnl/include/internal/cc.h b/reactos/ntoskrnl/include/internal/cc.h index 121240d5db9..291701b2590 100644 --- a/reactos/ntoskrnl/include/internal/cc.h +++ b/reactos/ntoskrnl/include/internal/cc.h @@ -104,8 +104,6 @@ typedef struct _PFSN_PREFETCHER_GLOBALS typedef struct _BCB { LIST_ENTRY BcbVacbListHead; - LIST_ENTRY BcbRemoveListEntry; - BOOLEAN RemoveOnClose; ULONG TimeStamp; PFILE_OBJECT FileObject; LARGE_INTEGER AllocationSize; @@ -264,7 +262,7 @@ CcRosReferenceCache(PFILE_OBJECT FileObject); VOID NTAPI -CcRosSetRemoveOnClose(PSECTION_OBJECT_POINTERS SectionObjectPointer); +CcRosRemoveIfClosed(PSECTION_OBJECT_POINTERS SectionObjectPointer); NTSTATUS NTAPI diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 2e7c2e45bd7..acde62a6796 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -4720,7 +4720,7 @@ MmFlushImageSection (IN PSECTION_OBJECT_POINTERS SectionObjectPointer, return FALSE; } #ifndef NEWCC - CcRosSetRemoveOnClose(SectionObjectPointer); + CcRosRemoveIfClosed(SectionObjectPointer); #endif return TRUE; case MmFlushForWrite: