https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9b6240ee03eef58f1113b…
commit 9b6240ee03eef58f1113bc6897269d379f68141d
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Tue Jan 5 10:41:41 2021 +0100
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Wed Feb 3 09:41:23 2021 +0100
[NTOS:CC] Get rid of ROS_VACB:Valid
---
ntoskrnl/cc/copy.c | 14 +++++++-------
ntoskrnl/cc/pin.c | 10 ++++------
ntoskrnl/cc/view.c | 23 ++++++-----------------
ntoskrnl/include/internal/cc.h | 3 ---
4 files changed, 17 insertions(+), 33 deletions(-)
diff --git a/ntoskrnl/cc/copy.c b/ntoskrnl/cc/copy.c
index 502dfb03ee8..677ab00dd2f 100644
--- a/ntoskrnl/cc/copy.c
+++ b/ntoskrnl/cc/copy.c
@@ -227,12 +227,12 @@ CcPerformReadAhead(
CurrentOffset % VACB_MAPPING_GRANULARITY, PartialLength);
if (!NT_SUCCESS(Status))
{
- CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE);
DPRINT1("Failed to read data: %lx!\n", Status);
goto Clear;
}
- CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE);
Length -= PartialLength;
CurrentOffset += PartialLength;
@@ -254,12 +254,12 @@ CcPerformReadAhead(
Status = CcRosEnsureVacbResident(Vacb, TRUE, FALSE, 0, PartialLength);
if (!NT_SUCCESS(Status))
{
- CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE);
DPRINT1("Failed to read data: %lx!\n", Status);
goto Clear;
}
- CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE);
Length -= PartialLength;
CurrentOffset += PartialLength;
@@ -548,7 +548,7 @@ CcCopyRead (
}
_SEH2_FINALLY
{
- CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE);
}
_SEH2_END;
}
@@ -653,7 +653,7 @@ CcCopyWrite (
_SEH2_FINALLY
{
/* Do not mark the VACB as dirty if an exception was raised */
- CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, !_SEH2_AbnormalTermination(),
FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, !_SEH2_AbnormalTermination(), FALSE);
}
_SEH2_END;
}
@@ -905,7 +905,7 @@ CcZeroData (
_SEH2_FINALLY
{
/* Do not mark the VACB as dirty if an exception was raised */
- CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, !_SEH2_AbnormalTermination(),
FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, !_SEH2_AbnormalTermination(), FALSE);
}
_SEH2_END;
}
diff --git a/ntoskrnl/cc/pin.c b/ntoskrnl/cc/pin.c
index 12b5f87018b..ae62d2da0bc 100644
--- a/ntoskrnl/cc/pin.c
+++ b/ntoskrnl/cc/pin.c
@@ -91,7 +91,6 @@ CcpDereferenceBcb(
*/
CcRosReleaseVacb(SharedCacheMap,
Bcb->Vacb,
- TRUE,
FALSE,
FALSE);
@@ -121,7 +120,7 @@ CcpGetAppropriateBcb(
iBcb = ExAllocateFromNPagedLookasideList(&iBcbLookasideList);
if (iBcb == NULL)
{
- CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE);
return NULL;
}
@@ -172,7 +171,7 @@ CcpGetAppropriateBcb(
if (DupBcb != NULL)
{
/* Delete the loser */
- CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE);
ExDeleteResourceLite(&iBcb->Lock);
ExFreeToNPagedLookasideList(&iBcbLookasideList, iBcb);
}
@@ -282,7 +281,7 @@ CcpPinData(
NewBcb = CcpGetAppropriateBcb(SharedCacheMap, Vacb, FileOffset, Length, Flags,
TRUE);
if (NewBcb == NULL)
{
- CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE);
return FALSE;
}
}
@@ -383,7 +382,7 @@ CcMapData (
iBcb = CcpGetAppropriateBcb(SharedCacheMap, Vacb, FileOffset, Length, 0, FALSE);
if (iBcb == NULL)
{
- CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE);
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu
Flags=0x%lx -> FALSE\n",
SharedCacheMap->FileObject, FileOffset, Length, Flags);
return FALSE;
@@ -660,7 +659,6 @@ CcUnpinRepinnedBcb (
*/
CcRosReleaseVacb(iBcb->Vacb->SharedCacheMap,
iBcb->Vacb,
- TRUE,
FALSE,
FALSE);
diff --git a/ntoskrnl/cc/view.c b/ntoskrnl/cc/view.c
index b6b7ec57560..1bd86b2cab7 100644
--- a/ntoskrnl/cc/view.c
+++ b/ntoskrnl/cc/view.c
@@ -342,17 +342,13 @@ NTAPI
CcRosReleaseVacb (
PROS_SHARED_CACHE_MAP SharedCacheMap,
PROS_VACB Vacb,
- BOOLEAN Valid,
BOOLEAN Dirty,
BOOLEAN Mapped)
{
ULONG Refs;
ASSERT(SharedCacheMap);
- DPRINT("CcRosReleaseVacb(SharedCacheMap 0x%p, Vacb 0x%p, Valid %u)\n",
- SharedCacheMap, Vacb, Valid);
-
- Vacb->Valid = Valid;
+ DPRINT("CcRosReleaseVacb(SharedCacheMap 0x%p, Vacb 0x%p)\n",
SharedCacheMap, Vacb);
if (Dirty && !Vacb->Dirty)
{
@@ -595,7 +591,6 @@ CcRosCreateVacb (
current = ExAllocateFromNPagedLookasideList(&VacbLookasideList);
current->BaseAddress = NULL;
- current->Valid = FALSE;
current->Dirty = FALSE;
current->PageOut = FALSE;
current->FileOffset.QuadPart = ROUND_DOWN(FileOffset, VACB_MAPPING_GRANULARITY);
@@ -947,7 +942,7 @@ CcFlushCache (
}
}
- CcRosReleaseVacb(SharedCacheMap, current, current->Valid, FALSE,
FALSE);
+ CcRosReleaseVacb(SharedCacheMap, current, FALSE, FALSE);
}
Offset.QuadPart += VACB_MAPPING_GRANULARITY;
@@ -1371,14 +1366,14 @@ ExpKdbgExtFileCache(ULONG Argc, PCHAR Argv[])
UNICODE_STRING NoName = RTL_CONSTANT_STRING(L"No name for File");
KdbpPrint(" Usage Summary (in kb)\n");
- KdbpPrint("Shared\t\tValid\tDirty\tName\n");
+ KdbpPrint("Shared\t\tMapped\tDirty\tName\n");
/* No need to lock the spin lock here, we're in DBG */
for (ListEntry = CcCleanSharedCacheMapList.Flink;
ListEntry != &CcCleanSharedCacheMapList;
ListEntry = ListEntry->Flink)
{
PLIST_ENTRY Vacbs;
- ULONG Valid = 0, Dirty = 0;
+ ULONG Mapped = 0, Dirty = 0;
PROS_SHARED_CACHE_MAP SharedCacheMap;
PUNICODE_STRING FileName;
PWSTR Extra = L"";
@@ -1393,13 +1388,7 @@ ExpKdbgExtFileCache(ULONG Argc, PCHAR Argv[])
Vacbs != &SharedCacheMap->CacheMapVacbListHead;
Vacbs = Vacbs->Flink)
{
- PROS_VACB Vacb;
-
- Vacb = CONTAINING_RECORD(Vacbs, ROS_VACB, CacheMapVacbListEntry);
- if (Vacb->Valid)
- {
- Valid += VACB_MAPPING_GRANULARITY / 1024;
- }
+ Mapped += VACB_MAPPING_GRANULARITY / 1024;
}
/* Setup name */
@@ -1423,7 +1412,7 @@ ExpKdbgExtFileCache(ULONG Argc, PCHAR Argv[])
}
/* And print */
- KdbpPrint("%p\t%d\t%d\t%wZ%S\n", SharedCacheMap, Valid, Dirty,
FileName, Extra);
+ KdbpPrint("%p\t%d\t%d\t%wZ%S\n", SharedCacheMap, Mapped, Dirty,
FileName, Extra);
}
return TRUE;
diff --git a/ntoskrnl/include/internal/cc.h b/ntoskrnl/include/internal/cc.h
index 32692c01db0..6416b2e7d3d 100644
--- a/ntoskrnl/include/internal/cc.h
+++ b/ntoskrnl/include/internal/cc.h
@@ -206,8 +206,6 @@ typedef struct _ROS_VACB
{
/* Base address of the region where the view's data is mapped. */
PVOID BaseAddress;
- /* Are the contents of the view valid. */
- BOOLEAN Valid;
/* Are the contents of the view newer than those on disk. */
BOOLEAN Dirty;
/* Page out in progress */
@@ -387,7 +385,6 @@ NTAPI
CcRosReleaseVacb(
PROS_SHARED_CACHE_MAP SharedCacheMap,
PROS_VACB Vacb,
- BOOLEAN Valid,
BOOLEAN Dirty,
BOOLEAN Mapped
);