From 0e932c7bef7641314c54b149a1b3a6a4589c2ef1 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Wed, 7 Feb 2018 22:23:25 +0100 Subject: [PATCH] [NTOSKRNL] Drop the CcTryToInitializeFileCache() which is actually doing nothing relevant --- ntoskrnl/cc/view.c | 31 ------------------------------- ntoskrnl/include/internal/cc.h | 4 ---- ntoskrnl/mm/section.c | 12 +----------- 3 files changed, 1 insertion(+), 46 deletions(-) diff --git a/ntoskrnl/cc/view.c b/ntoskrnl/cc/view.c index 2e8fb6c51e1..1b4468cd416 100644 --- a/ntoskrnl/cc/view.c +++ b/ntoskrnl/cc/view.c @@ -1197,37 +1197,6 @@ CcRosReleaseFileCache ( return STATUS_SUCCESS; } -NTSTATUS -NTAPI -CcTryToInitializeFileCache ( - PFILE_OBJECT FileObject) -{ - PROS_SHARED_CACHE_MAP SharedCacheMap; - NTSTATUS Status; - - KeAcquireGuardedMutex(&ViewLock); - - ASSERT(FileObject->SectionObjectPointer); - SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; - if (SharedCacheMap == NULL) - { - Status = STATUS_UNSUCCESSFUL; - } - else - { - if (FileObject->PrivateCacheMap == NULL) - { - FileObject->PrivateCacheMap = SharedCacheMap; - SharedCacheMap->OpenCount++; - } - Status = STATUS_SUCCESS; - } - KeReleaseGuardedMutex(&ViewLock); - - return Status; -} - - NTSTATUS NTAPI CcRosInitializeFileCache ( diff --git a/ntoskrnl/include/internal/cc.h b/ntoskrnl/include/internal/cc.h index 3a44fda908f..f78e9c04919 100644 --- a/ntoskrnl/include/internal/cc.h +++ b/ntoskrnl/include/internal/cc.h @@ -406,10 +406,6 @@ CcRosReleaseFileCache( PFILE_OBJECT FileObject ); -NTSTATUS -NTAPI -CcTryToInitializeFileCache(PFILE_OBJECT FileObject); - VOID NTAPI CcShutdownSystem(VOID); diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c index 5c954395a9f..b588f1c6172 100644 --- a/ntoskrnl/mm/section.c +++ b/ntoskrnl/mm/section.c @@ -3758,17 +3758,7 @@ MmCreateImageSection(PROS_SECTION_OBJECT *SectionObject, Section->SectionPageProtection = SectionPageProtection; Section->AllocationAttributes = AllocationAttributes; -#ifndef NEWCC - /* - * Initialized caching for this file object if previously caching - * was initialized for the same on disk file - */ - Status = CcTryToInitializeFileCache(FileObject); -#else - Status = STATUS_SUCCESS; -#endif - - if (!NT_SUCCESS(Status) || FileObject->SectionObjectPointer->ImageSectionObject == NULL) + if (FileObject->SectionObjectPointer->ImageSectionObject == NULL) { NTSTATUS StatusExeFmt;