[NTOS:CC]

- Remove remnants of long-unused delayed remove/close feature (added in r3970, removed in r39663)

svn path=/trunk/; revision=62711
This commit is contained in:
Thomas Faber 2014-04-12 10:37:08 +00:00
parent aa5418c1d0
commit 467aa6f585
3 changed files with 7 additions and 41 deletions

View file

@ -44,7 +44,6 @@
static LIST_ENTRY DirtyVacbListHead; static LIST_ENTRY DirtyVacbListHead;
static LIST_ENTRY VacbListHead; static LIST_ENTRY VacbListHead;
static LIST_ENTRY VacbLruListHead; static LIST_ENTRY VacbLruListHead;
static LIST_ENTRY ClosedListHead;
ULONG DirtyPageCount = 0; ULONG DirtyPageCount = 0;
KGUARDED_MUTEX ViewLock; KGUARDED_MUTEX ViewLock;
@ -1026,12 +1025,6 @@ CcRosDeleteFileCache (
Bcb->RefCount--; Bcb->RefCount--;
if (Bcb->RefCount == 0) if (Bcb->RefCount == 0)
{ {
if (Bcb->BcbRemoveListEntry.Flink != NULL)
{
RemoveEntryList(&Bcb->BcbRemoveListEntry);
Bcb->BcbRemoveListEntry.Flink = NULL;
}
FileObject->SectionObjectPointer->SharedCacheMap = NULL; FileObject->SectionObjectPointer->SharedCacheMap = NULL;
/* /*
@ -1082,37 +1075,23 @@ CcRosReferenceCache (
KeAcquireGuardedMutex(&ViewLock); KeAcquireGuardedMutex(&ViewLock);
Bcb = (PBCB)FileObject->SectionObjectPointer->SharedCacheMap; Bcb = (PBCB)FileObject->SectionObjectPointer->SharedCacheMap;
ASSERT(Bcb); ASSERT(Bcb);
if (Bcb->RefCount == 0) ASSERT(Bcb->RefCount != 0);
{
ASSERT(Bcb->BcbRemoveListEntry.Flink != NULL);
RemoveEntryList(&Bcb->BcbRemoveListEntry);
Bcb->BcbRemoveListEntry.Flink = NULL;
}
else
{
ASSERT(Bcb->BcbRemoveListEntry.Flink == NULL);
}
Bcb->RefCount++; Bcb->RefCount++;
KeReleaseGuardedMutex(&ViewLock); KeReleaseGuardedMutex(&ViewLock);
} }
VOID VOID
NTAPI NTAPI
CcRosSetRemoveOnClose ( CcRosRemoveIfClosed (
PSECTION_OBJECT_POINTERS SectionObjectPointer) PSECTION_OBJECT_POINTERS SectionObjectPointer)
{ {
PBCB Bcb; PBCB Bcb;
DPRINT("CcRosSetRemoveOnClose()\n"); DPRINT("CcRosRemoveIfClosed()\n");
KeAcquireGuardedMutex(&ViewLock); KeAcquireGuardedMutex(&ViewLock);
Bcb = (PBCB)SectionObjectPointer->SharedCacheMap; Bcb = (PBCB)SectionObjectPointer->SharedCacheMap;
if (Bcb) if (Bcb && Bcb->RefCount == 0)
{ {
Bcb->RemoveOnClose = TRUE; CcRosDeleteFileCache(Bcb->FileObject, Bcb);
if (Bcb->RefCount == 0)
{
CcRosDeleteFileCache(Bcb->FileObject, Bcb);
}
} }
KeReleaseGuardedMutex(&ViewLock); KeReleaseGuardedMutex(&ViewLock);
} }
@ -1196,11 +1175,6 @@ CcTryToInitializeFileCache (
FileObject->PrivateCacheMap = Bcb; FileObject->PrivateCacheMap = Bcb;
Bcb->RefCount++; Bcb->RefCount++;
} }
if (Bcb->BcbRemoveListEntry.Flink != NULL)
{
RemoveEntryList(&Bcb->BcbRemoveListEntry);
Bcb->BcbRemoveListEntry.Flink = NULL;
}
Status = STATUS_SUCCESS; Status = STATUS_SUCCESS;
} }
KeReleaseGuardedMutex(&ViewLock); KeReleaseGuardedMutex(&ViewLock);
@ -1258,11 +1232,6 @@ CcRosInitializeFileCache (
FileObject->PrivateCacheMap = Bcb; FileObject->PrivateCacheMap = Bcb;
Bcb->RefCount++; Bcb->RefCount++;
} }
if (Bcb->BcbRemoveListEntry.Flink != NULL)
{
RemoveEntryList(&Bcb->BcbRemoveListEntry);
Bcb->BcbRemoveListEntry.Flink = NULL;
}
KeReleaseGuardedMutex(&ViewLock); KeReleaseGuardedMutex(&ViewLock);
return STATUS_SUCCESS; return STATUS_SUCCESS;
@ -1297,7 +1266,6 @@ CcInitView (
InitializeListHead(&VacbListHead); InitializeListHead(&VacbListHead);
InitializeListHead(&DirtyVacbListHead); InitializeListHead(&DirtyVacbListHead);
InitializeListHead(&VacbLruListHead); InitializeListHead(&VacbLruListHead);
InitializeListHead(&ClosedListHead);
KeInitializeGuardedMutex(&ViewLock); KeInitializeGuardedMutex(&ViewLock);
ExInitializeNPagedLookasideList (&iBcbLookasideList, ExInitializeNPagedLookasideList (&iBcbLookasideList,
NULL, NULL,

View file

@ -104,8 +104,6 @@ typedef struct _PFSN_PREFETCHER_GLOBALS
typedef struct _BCB typedef struct _BCB
{ {
LIST_ENTRY BcbVacbListHead; LIST_ENTRY BcbVacbListHead;
LIST_ENTRY BcbRemoveListEntry;
BOOLEAN RemoveOnClose;
ULONG TimeStamp; ULONG TimeStamp;
PFILE_OBJECT FileObject; PFILE_OBJECT FileObject;
LARGE_INTEGER AllocationSize; LARGE_INTEGER AllocationSize;
@ -264,7 +262,7 @@ CcRosReferenceCache(PFILE_OBJECT FileObject);
VOID VOID
NTAPI NTAPI
CcRosSetRemoveOnClose(PSECTION_OBJECT_POINTERS SectionObjectPointer); CcRosRemoveIfClosed(PSECTION_OBJECT_POINTERS SectionObjectPointer);
NTSTATUS NTSTATUS
NTAPI NTAPI

View file

@ -4720,7 +4720,7 @@ MmFlushImageSection (IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
return FALSE; return FALSE;
} }
#ifndef NEWCC #ifndef NEWCC
CcRosSetRemoveOnClose(SectionObjectPointer); CcRosRemoveIfClosed(SectionObjectPointer);
#endif #endif
return TRUE; return TRUE;
case MmFlushForWrite: case MmFlushForWrite: