mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[NTOS:CC] Unintialize private cache maps before purging the cache section
Before purging the data cache of a certain section of a file from system cache, we have to unintialize the private cache maps of that section if a filesystem or any other component prompts the kernel to do so.
This commit is contained in:
parent
8c6dcdcf81
commit
8bd980e483
1 changed files with 24 additions and 5 deletions
|
@ -161,6 +161,7 @@ CcPurgeCacheSection (
|
|||
IN BOOLEAN UninitializeCacheMaps)
|
||||
{
|
||||
PROS_SHARED_CACHE_MAP SharedCacheMap;
|
||||
PPRIVATE_CACHE_MAP PrivateCacheMap;
|
||||
LONGLONG StartOffset;
|
||||
LONGLONG EndOffset;
|
||||
LIST_ENTRY FreeList;
|
||||
|
@ -173,11 +174,7 @@ CcPurgeCacheSection (
|
|||
CCTRACE(CC_API_DEBUG, "SectionObjectPointer=%p\n FileOffset=%p Length=%lu UninitializeCacheMaps=%d",
|
||||
SectionObjectPointer, FileOffset, Length, UninitializeCacheMaps);
|
||||
|
||||
if (UninitializeCacheMaps)
|
||||
{
|
||||
DPRINT1("FIXME: CcPurgeCacheSection not uninitializing private cache maps\n");
|
||||
}
|
||||
|
||||
/* Obtain the shared cache from the section */
|
||||
SharedCacheMap = SectionObjectPointer->SharedCacheMap;
|
||||
if (!SharedCacheMap)
|
||||
{
|
||||
|
@ -185,6 +182,28 @@ CcPurgeCacheSection (
|
|||
goto purgeMm;
|
||||
}
|
||||
|
||||
if (UninitializeCacheMaps)
|
||||
{
|
||||
/*
|
||||
* We have gotten the acknowledgement that
|
||||
* the caller wants to unintialize the private
|
||||
* cache maps so let's do this. Since we already
|
||||
* have the shared cache map from above, iterate
|
||||
* over that cache's private lists.
|
||||
*/
|
||||
while (!IsListEmpty(&SharedCacheMap->PrivateList))
|
||||
{
|
||||
/*
|
||||
* This list is not empty, grab the
|
||||
* private cache map.
|
||||
*/
|
||||
PrivateCacheMap = CONTAINING_RECORD(SharedCacheMap->PrivateList.Flink, PRIVATE_CACHE_MAP, PrivateLinks);
|
||||
|
||||
/* Unintialize the private cache now */
|
||||
CcUninitializeCacheMap(PrivateCacheMap->FileObject, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
StartOffset = FileOffset != NULL ? FileOffset->QuadPart : 0;
|
||||
if (Length == 0 || FileOffset == NULL)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue