Author: tfaber
Date: Sat Apr 12 10:59:48 2014
New Revision: 62713
URL:
http://svn.reactos.org/svn/reactos?rev=62713&view=rev
Log:
[NTOS:CC]
- Rename the BCB structure to ROS_SHARED_CACHE_MAP. This should eventually become
NDK's SHARED_CACHE_MAP.
CORE-8065
Modified:
trunk/reactos/ntoskrnl/cc/copy.c
trunk/reactos/ntoskrnl/cc/fs.c
trunk/reactos/ntoskrnl/cc/pin.c
trunk/reactos/ntoskrnl/cc/view.c
trunk/reactos/ntoskrnl/include/internal/cc.h
trunk/reactos/ntoskrnl/mm/section.c
Modified: trunk/reactos/ntoskrnl/cc/copy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/copy.c?rev=627…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/copy.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/copy.c [iso-8859-1] Sat Apr 12 10:59:48 2014
@@ -57,7 +57,7 @@
NTSTATUS
NTAPI
ReadVacbChain (
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG ReadOffset,
ULONG Length,
PVOID Buffer)
@@ -74,7 +74,7 @@
Mdl = _alloca(MmSizeOfMdl(NULL, MAX_RW_LENGTH));
- Status = CcRosGetVacbChain(Bcb, ReadOffset, Length, &head);
+ Status = CcRosGetVacbChain(SharedCacheMap, ReadOffset, Length, &head);
if (!NT_SUCCESS(Status))
{
return Status;
@@ -95,7 +95,7 @@
Length = Length - TempLength;
previous = current;
current = current->NextInChain;
- CcRosReleaseVacb(Bcb, previous, TRUE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, previous, TRUE, FALSE, FALSE);
}
/*
* Otherwise read in as much as we can.
@@ -143,7 +143,7 @@
*/
VacbOffset.QuadPart = current->FileOffset;
KeInitializeEvent(&Event, NotificationEvent, FALSE);
- Status = IoPageRead(Bcb->FileObject,
+ Status = IoPageRead(SharedCacheMap->FileObject,
Mdl,
&VacbOffset,
&Event,
@@ -163,7 +163,7 @@
{
previous = current;
current = current->NextInChain;
- CcRosReleaseVacb(Bcb, previous, FALSE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, previous, FALSE, FALSE, FALSE);
}
return Status;
}
@@ -178,7 +178,7 @@
Buffer = (PVOID)((ULONG_PTR)Buffer + TempLength);
Length = Length - TempLength;
- CcRosReleaseVacb(Bcb, previous, TRUE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, previous, TRUE, FALSE, FALSE);
current_size += VACB_MAPPING_GRANULARITY;
}
}
@@ -199,7 +199,7 @@
KEVENT Event;
VacbOffset.QuadPart = Vacb->FileOffset;
- Size = (ULONG)(Vacb->Bcb->AllocationSize.QuadPart - Vacb->FileOffset);
+ Size = (ULONG)(Vacb->SharedCacheMap->AllocationSize.QuadPart -
Vacb->FileOffset);
if (Size > VACB_MAPPING_GRANULARITY)
{
Size = VACB_MAPPING_GRANULARITY;
@@ -214,7 +214,7 @@
MmBuildMdlForNonPagedPool(Mdl);
Mdl->MdlFlags |= MDL_IO_PAGE_READ;
KeInitializeEvent(&Event, NotificationEvent, FALSE);
- Status = IoPageRead(Vacb->Bcb->FileObject, Mdl, &VacbOffset, &Event,
&IoStatus);
+ Status = IoPageRead(Vacb->SharedCacheMap->FileObject, Mdl, &VacbOffset,
&Event, &IoStatus);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@@ -252,7 +252,7 @@
Vacb->Dirty = FALSE;
VacbOffset.QuadPart = Vacb->FileOffset;
- Size = (ULONG)(Vacb->Bcb->AllocationSize.QuadPart - Vacb->FileOffset);
+ Size = (ULONG)(Vacb->SharedCacheMap->AllocationSize.QuadPart -
Vacb->FileOffset);
if (Size > VACB_MAPPING_GRANULARITY)
{
Size = VACB_MAPPING_GRANULARITY;
@@ -277,7 +277,7 @@
MmBuildMdlForNonPagedPool(Mdl);
Mdl->MdlFlags |= MDL_IO_PAGE_READ;
KeInitializeEvent(&Event, NotificationEvent, FALSE);
- Status = IoSynchronousPageWrite(Vacb->Bcb->FileObject, Mdl, &VacbOffset,
&Event, &IoStatus);
+ Status = IoSynchronousPageWrite(Vacb->SharedCacheMap->FileObject, Mdl,
&VacbOffset, &Event, &IoStatus);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@@ -331,7 +331,7 @@
PROS_VACB Vacb;
BOOLEAN Valid;
ULONG ReadLength = 0;
- PBCB Bcb;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
KIRQL oldirql;
PLIST_ENTRY current_entry;
PROS_VACB current;
@@ -341,12 +341,12 @@
FileObject, FileOffset->QuadPart, Length, Wait,
Buffer, IoStatus);
- Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
ReadOffset = (ULONG)FileOffset->QuadPart;
DPRINT("AllocationSize %I64d, FileSize %I64d\n",
- Bcb->AllocationSize.QuadPart,
- Bcb->FileSize.QuadPart);
+ SharedCacheMap->AllocationSize.QuadPart,
+ SharedCacheMap->FileSize.QuadPart);
/*
* Check for the nowait case that all the cache VACBs that would
@@ -354,19 +354,20 @@
*/
if (!Wait)
{
- KeAcquireSpinLock(&Bcb->BcbLock, &oldirql);
+ KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql);
/* FIXME: this loop doesn't take into account areas that don't have
* a VACB in the list yet */
- current_entry = Bcb->BcbVacbListHead.Flink;
- while (current_entry != &Bcb->BcbVacbListHead)
- {
- current = CONTAINING_RECORD(current_entry, ROS_VACB,
- BcbVacbListEntry);
+ current_entry = SharedCacheMap->CacheMapVacbListHead.Flink;
+ while (current_entry != &SharedCacheMap->CacheMapVacbListHead)
+ {
+ current = CONTAINING_RECORD(current_entry,
+ ROS_VACB,
+ CacheMapVacbListEntry);
if (!current->Valid &&
DoRangesIntersect(current->FileOffset, VACB_MAPPING_GRANULARITY,
ReadOffset, Length))
{
- KeReleaseSpinLock(&Bcb->BcbLock, oldirql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
IoStatus->Status = STATUS_UNSUCCESSFUL;
IoStatus->Information = 0;
return FALSE;
@@ -375,14 +376,14 @@
break;
current_entry = current_entry->Flink;
}
- KeReleaseSpinLock(&Bcb->BcbLock, oldirql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
}
TempLength = ReadOffset % VACB_MAPPING_GRANULARITY;
if (TempLength != 0)
{
TempLength = min(Length, VACB_MAPPING_GRANULARITY - TempLength);
- Status = CcRosRequestVacb(Bcb,
+ Status = CcRosRequestVacb(SharedCacheMap,
ROUND_DOWN(ReadOffset,
VACB_MAPPING_GRANULARITY),
&BaseAddress, &Valid, &Vacb);
@@ -400,14 +401,14 @@
{
IoStatus->Information = 0;
IoStatus->Status = Status;
- CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE);
return FALSE;
}
}
RtlCopyMemory(Buffer,
(char*)BaseAddress + ReadOffset % VACB_MAPPING_GRANULARITY,
TempLength);
- CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
ReadLength += TempLength;
Length -= TempLength;
ReadOffset += TempLength;
@@ -417,7 +418,7 @@
while (Length > 0)
{
TempLength = min(VACB_MAPPING_GRANULARITY, Length);
- Status = ReadVacbChain(Bcb, ReadOffset, TempLength, Buffer);
+ Status = ReadVacbChain(SharedCacheMap, ReadOffset, TempLength, Buffer);
if (!NT_SUCCESS(Status))
{
IoStatus->Information = 0;
@@ -454,7 +455,7 @@
NTSTATUS Status;
ULONG WriteOffset;
KIRQL oldirql;
- PBCB Bcb;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
PLIST_ENTRY current_entry;
PROS_VACB Vacb;
ULONG TempLength;
@@ -465,26 +466,26 @@
"Length %lu, Wait %u, Buffer 0x%p)\n",
FileObject, FileOffset->QuadPart, Length, Wait, Buffer);
- Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
WriteOffset = (ULONG)FileOffset->QuadPart;
if (!Wait)
{
/* testing, if the requested datas are available */
- KeAcquireSpinLock(&Bcb->BcbLock, &oldirql);
+ KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql);
/* FIXME: this loop doesn't take into account areas that don't have
* a VACB in the list yet */
- current_entry = Bcb->BcbVacbListHead.Flink;
- while (current_entry != &Bcb->BcbVacbListHead)
+ current_entry = SharedCacheMap->CacheMapVacbListHead.Flink;
+ while (current_entry != &SharedCacheMap->CacheMapVacbListHead)
{
Vacb = CONTAINING_RECORD(current_entry,
ROS_VACB,
- BcbVacbListEntry);
+ CacheMapVacbListEntry);
if (!Vacb->Valid &&
DoRangesIntersect(Vacb->FileOffset, VACB_MAPPING_GRANULARITY,
WriteOffset, Length))
{
- KeReleaseSpinLock(&Bcb->BcbLock, oldirql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
/* datas not available */
return FALSE;
}
@@ -492,7 +493,7 @@
break;
current_entry = current_entry->Flink;
}
- KeReleaseSpinLock(&Bcb->BcbLock, oldirql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
}
TempLength = WriteOffset % VACB_MAPPING_GRANULARITY;
@@ -501,7 +502,7 @@
ULONG ROffset;
ROffset = ROUND_DOWN(WriteOffset, VACB_MAPPING_GRANULARITY);
TempLength = min(Length, VACB_MAPPING_GRANULARITY - TempLength);
- Status = CcRosRequestVacb(Bcb, ROffset,
+ Status = CcRosRequestVacb(SharedCacheMap, ROffset,
&BaseAddress, &Valid, &Vacb);
if (!NT_SUCCESS(Status))
{
@@ -517,7 +518,7 @@
RtlCopyMemory((char*)BaseAddress + WriteOffset % VACB_MAPPING_GRANULARITY,
Buffer,
TempLength);
- CcRosReleaseVacb(Bcb, Vacb, TRUE, TRUE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, TRUE, FALSE);
Length -= TempLength;
WriteOffset += TempLength;
@@ -528,7 +529,7 @@
while (Length > 0)
{
TempLength = min(VACB_MAPPING_GRANULARITY, Length);
- Status = CcRosRequestVacb(Bcb,
+ Status = CcRosRequestVacb(SharedCacheMap,
WriteOffset,
&BaseAddress,
&Valid,
@@ -541,12 +542,12 @@
{
if (!NT_SUCCESS(CcReadVirtualAddress(Vacb)))
{
- CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE);
return FALSE;
}
}
RtlCopyMemory(BaseAddress, Buffer, TempLength);
- CcRosReleaseVacb(Bcb, Vacb, TRUE, TRUE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, TRUE, FALSE);
Length -= TempLength;
WriteOffset += TempLength;
@@ -684,29 +685,29 @@
{
/* File is cached */
KIRQL oldirql;
- PBCB Bcb;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
PLIST_ENTRY current_entry;
PROS_VACB Vacb, current, previous;
ULONG TempLength;
- Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
if (!Wait)
{
/* testing, if the requested datas are available */
- KeAcquireSpinLock(&Bcb->BcbLock, &oldirql);
+ KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql);
/* FIXME: this loop doesn't take into account areas that don't have
* a VACB in the list yet */
- current_entry = Bcb->BcbVacbListHead.Flink;
- while (current_entry != &Bcb->BcbVacbListHead)
+ current_entry = SharedCacheMap->CacheMapVacbListHead.Flink;
+ while (current_entry != &SharedCacheMap->CacheMapVacbListHead)
{
Vacb = CONTAINING_RECORD(current_entry,
ROS_VACB,
- BcbVacbListEntry);
+ CacheMapVacbListEntry);
if (!Vacb->Valid &&
DoRangesIntersect(Vacb->FileOffset, VACB_MAPPING_GRANULARITY,
WriteOffset.u.LowPart, Length))
{
- KeReleaseSpinLock(&Bcb->BcbLock, oldirql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
/* datas not available */
return FALSE;
}
@@ -714,7 +715,7 @@
break;
current_entry = current_entry->Flink;
}
- KeReleaseSpinLock(&Bcb->BcbLock, oldirql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
}
while (Length > 0)
@@ -729,7 +730,7 @@
{
CurrentLength = Length;
}
- Status = CcRosGetVacbChain(Bcb, WriteOffset.u.LowPart - Offset,
+ Status = CcRosGetVacbChain(SharedCacheMap, WriteOffset.u.LowPart - Offset,
Offset + CurrentLength, &Vacb);
if (!NT_SUCCESS(Status))
{
@@ -774,7 +775,7 @@
{
previous = current;
current = current->NextInChain;
- CcRosReleaseVacb(Bcb, previous, TRUE, TRUE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, previous, TRUE, TRUE, FALSE);
}
}
}
Modified: trunk/reactos/ntoskrnl/cc/fs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/fs.c?rev=62713…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/fs.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/fs.c [iso-8859-1] Sat Apr 12 10:59:48 2014
@@ -52,7 +52,7 @@
IN PVOID Bcb)
{
PINTERNAL_BCB iBcb = (PINTERNAL_BCB)Bcb;
- return iBcb->Vacb->Bcb->FileObject;
+ return iBcb->Vacb->SharedCacheMap->FileObject;
}
/*
@@ -128,7 +128,7 @@
IN PCC_FILE_SIZES FileSizes)
{
KIRQL oldirql;
- PBCB Bcb;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
PLIST_ENTRY current_entry;
PROS_VACB current;
LIST_ENTRY FreeListHead;
@@ -141,33 +141,33 @@
FileSizes->FileSize.QuadPart,
FileSizes->ValidDataLength.QuadPart);
- Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
/*
* It is valid to call this function on file objects that weren't
* initialized for caching. In this case it's simple no-op.
*/
- if (Bcb == NULL)
+ if (SharedCacheMap == NULL)
return;
- if (FileSizes->AllocationSize.QuadPart < Bcb->AllocationSize.QuadPart)
+ if (FileSizes->AllocationSize.QuadPart <
SharedCacheMap->AllocationSize.QuadPart)
{
InitializeListHead(&FreeListHead);
KeAcquireGuardedMutex(&ViewLock);
- KeAcquireSpinLock(&Bcb->BcbLock, &oldirql);
-
- current_entry = Bcb->BcbVacbListHead.Flink;
- while (current_entry != &Bcb->BcbVacbListHead)
+ KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql);
+
+ current_entry = SharedCacheMap->CacheMapVacbListHead.Flink;
+ while (current_entry != &SharedCacheMap->CacheMapVacbListHead)
{
current = CONTAINING_RECORD(current_entry,
ROS_VACB,
- BcbVacbListEntry);
+ CacheMapVacbListEntry);
current_entry = current_entry->Flink;
if (current->FileOffset >= FileSizes->AllocationSize.QuadPart)
{
if ((current->ReferenceCount == 0) || ((current->ReferenceCount ==
1) && current->Dirty))
{
- RemoveEntryList(¤t->BcbVacbListEntry);
+ RemoveEntryList(¤t->CacheMapVacbListEntry);
RemoveEntryList(¤t->VacbListEntry);
RemoveEntryList(¤t->VacbLruListEntry);
if (current->Dirty)
@@ -175,7 +175,7 @@
RemoveEntryList(¤t->DirtyVacbListEntry);
DirtyPageCount -= VACB_MAPPING_GRANULARITY / PAGE_SIZE;
}
- InsertHeadList(&FreeListHead,
¤t->BcbVacbListEntry);
+ InsertHeadList(&FreeListHead,
¤t->CacheMapVacbListEntry);
}
else
{
@@ -185,15 +185,15 @@
}
}
- Bcb->AllocationSize = FileSizes->AllocationSize;
- Bcb->FileSize = FileSizes->FileSize;
- KeReleaseSpinLock(&Bcb->BcbLock, oldirql);
+ SharedCacheMap->AllocationSize = FileSizes->AllocationSize;
+ SharedCacheMap->FileSize = FileSizes->FileSize;
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
KeReleaseGuardedMutex(&ViewLock);
current_entry = FreeListHead.Flink;
while(current_entry != &FreeListHead)
{
- current = CONTAINING_RECORD(current_entry, ROS_VACB, BcbVacbListEntry);
+ current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry);
current_entry = current_entry->Flink;
Status = CcRosInternalFreeVacb(current);
if (!NT_SUCCESS(Status))
@@ -205,10 +205,10 @@
}
else
{
- KeAcquireSpinLock(&Bcb->BcbLock, &oldirql);
- Bcb->AllocationSize = FileSizes->AllocationSize;
- Bcb->FileSize = FileSizes->FileSize;
- KeReleaseSpinLock(&Bcb->BcbLock, oldirql);
+ KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql);
+ SharedCacheMap->AllocationSize = FileSizes->AllocationSize;
+ SharedCacheMap->FileSize = FileSizes->FileSize;
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
}
}
@@ -249,14 +249,14 @@
IN PFILE_OBJECT FileObject,
IN PCC_FILE_SIZES FileSizes)
{
- PBCB Bcb;
-
- Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
-
- if (!Bcb)
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
+
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
+
+ if (!SharedCacheMap)
return FALSE;
- FileSizes->AllocationSize = Bcb->AllocationSize;
- FileSizes->FileSize = FileSizes->ValidDataLength = Bcb->FileSize;
+ FileSizes->AllocationSize = SharedCacheMap->AllocationSize;
+ FileSizes->FileSize = FileSizes->ValidDataLength =
SharedCacheMap->FileSize;
return TRUE;
}
Modified: trunk/reactos/ntoskrnl/cc/pin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/pin.c?rev=6271…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/pin.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/pin.c [iso-8859-1] Sat Apr 12 10:59:48 2014
@@ -34,7 +34,7 @@
{
ULONG ReadOffset;
BOOLEAN Valid;
- PBCB Bcb;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
PROS_VACB Vacb;
NTSTATUS Status;
PINTERNAL_BCB iBcb;
@@ -50,12 +50,12 @@
ASSERT(FileObject->SectionObjectPointer);
ASSERT(FileObject->SectionObjectPointer->SharedCacheMap);
- Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
- ASSERT(Bcb);
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
+ ASSERT(SharedCacheMap);
DPRINT("AllocationSize %I64x, FileSize %I64x\n",
- Bcb->AllocationSize.QuadPart,
- Bcb->FileSize.QuadPart);
+ SharedCacheMap->AllocationSize.QuadPart,
+ SharedCacheMap->FileSize.QuadPart);
if (ReadOffset % VACB_MAPPING_GRANULARITY + Length > VACB_MAPPING_GRANULARITY)
{
@@ -63,7 +63,7 @@
}
ROffset = ROUND_DOWN(ReadOffset, VACB_MAPPING_GRANULARITY);
- Status = CcRosRequestVacb(Bcb,
+ Status = CcRosRequestVacb(SharedCacheMap,
ROffset,
pBuffer,
&Valid,
@@ -77,13 +77,13 @@
{
if (!(Flags & MAP_WAIT))
{
- CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE);
return FALSE;
}
if (!NT_SUCCESS(CcReadVirtualAddress(Vacb)))
{
- CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE);
return FALSE;
}
}
@@ -92,7 +92,7 @@
iBcb = ExAllocateFromNPagedLookasideList(&iBcbLookasideList);
if (iBcb == NULL)
{
- CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
return FALSE;
}
@@ -195,7 +195,7 @@
{
PINTERNAL_BCB iBcb = Bcb;
- CcRosReleaseVacb(iBcb->Vacb->Bcb,
+ CcRosReleaseVacb(iBcb->Vacb->SharedCacheMap,
iBcb->Vacb,
TRUE,
iBcb->Dirty,
Modified: trunk/reactos/ntoskrnl/cc/view.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=627…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] Sat Apr 12 10:59:48 2014
@@ -49,14 +49,14 @@
KGUARDED_MUTEX ViewLock;
NPAGED_LOOKASIDE_LIST iBcbLookasideList;
-static NPAGED_LOOKASIDE_LIST BcbLookasideList;
+static NPAGED_LOOKASIDE_LIST SharedCacheMapLookasideList;
static NPAGED_LOOKASIDE_LIST VacbLookasideList;
#if DBG
static void CcRosVacbIncRefCount_(PROS_VACB vacb, const char* file, int line)
{
++vacb->ReferenceCount;
- if (vacb->Bcb->Trace)
+ if (vacb->SharedCacheMap->Trace)
{
DbgPrint("(%s:%i) VACB %p ++RefCount=%lu, Dirty %u, PageOut %lu\n",
file, line, vacb, vacb->ReferenceCount, vacb->Dirty,
vacb->PageOut);
@@ -65,7 +65,7 @@
static void CcRosVacbDecRefCount_(PROS_VACB vacb, const char* file, int line)
{
--vacb->ReferenceCount;
- if (vacb->Bcb->Trace)
+ if (vacb->SharedCacheMap->Trace)
{
DbgPrint("(%s:%i) VACB %p --RefCount=%lu, Dirty %u, PageOut %lu\n",
file, line, vacb, vacb->ReferenceCount, vacb->Dirty,
vacb->PageOut);
@@ -87,7 +87,7 @@
VOID
NTAPI
CcRosTraceCacheMap (
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
BOOLEAN Trace )
{
#if DBG
@@ -95,38 +95,38 @@
PLIST_ENTRY current_entry;
PROS_VACB current;
- if ( !Bcb )
+ if (!SharedCacheMap)
return;
- Bcb->Trace = Trace;
-
- if ( Trace )
- {
- DPRINT1("Enabling Tracing for CacheMap 0x%p:\n", Bcb );
+ SharedCacheMap->Trace = Trace;
+
+ if (Trace)
+ {
+ DPRINT1("Enabling Tracing for CacheMap 0x%p:\n", SharedCacheMap);
KeAcquireGuardedMutex(&ViewLock);
- KeAcquireSpinLock(&Bcb->BcbLock, &oldirql);
-
- current_entry = Bcb->BcbVacbListHead.Flink;
- while (current_entry != &Bcb->BcbVacbListHead)
- {
- current = CONTAINING_RECORD(current_entry, ROS_VACB, BcbVacbListEntry);
+ KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql);
+
+ current_entry = SharedCacheMap->CacheMapVacbListHead.Flink;
+ while (current_entry != &SharedCacheMap->CacheMapVacbListHead)
+ {
+ current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry);
current_entry = current_entry->Flink;
DPRINT1(" VACB 0x%p enabled, RefCount %lu, Dirty %u, PageOut
%lu\n",
current, current->ReferenceCount, current->Dirty,
current->PageOut );
}
- KeReleaseSpinLock(&Bcb->BcbLock, oldirql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
KeReleaseGuardedMutex(&ViewLock);
}
else
{
- DPRINT1("Disabling Tracing for CacheMap 0x%p:\n", Bcb );
+ DPRINT1("Disabling Tracing for CacheMap 0x%p:\n", SharedCacheMap);
}
#else
- Bcb = Bcb;
- Trace = Trace;
+ UNREFERENCED_PARAMETER(SharedCacheMap);
+ UNREFERENCED_PARAMETER(Trace);
#endif
}
@@ -142,14 +142,14 @@
if (NT_SUCCESS(Status))
{
KeAcquireGuardedMutex(&ViewLock);
- KeAcquireSpinLock(&Vacb->Bcb->BcbLock, &oldIrql);
+ KeAcquireSpinLock(&Vacb->SharedCacheMap->CacheMapLock, &oldIrql);
Vacb->Dirty = FALSE;
RemoveEntryList(&Vacb->DirtyVacbListEntry);
DirtyPageCount -= VACB_MAPPING_GRANULARITY / PAGE_SIZE;
CcRosVacbDecRefCount(Vacb);
- KeReleaseSpinLock(&Vacb->Bcb->BcbLock, oldIrql);
+ KeReleaseSpinLock(&Vacb->SharedCacheMap->CacheMapLock, oldIrql);
KeReleaseGuardedMutex(&ViewLock);
}
@@ -192,8 +192,8 @@
CcRosVacbIncRefCount(current);
- Locked = current->Bcb->Callbacks->AcquireForLazyWrite(
- current->Bcb->LazyWriteContext, Wait);
+ Locked = current->SharedCacheMap->Callbacks->AcquireForLazyWrite(
+ current->SharedCacheMap->LazyWriteContext, Wait);
if (!Locked)
{
CcRosVacbDecRefCount(current);
@@ -207,8 +207,8 @@
Wait ? NULL : &ZeroTimeout);
if (Status != STATUS_SUCCESS)
{
- current->Bcb->Callbacks->ReleaseFromLazyWrite(
- current->Bcb->LazyWriteContext);
+ current->SharedCacheMap->Callbacks->ReleaseFromLazyWrite(
+ current->SharedCacheMap->LazyWriteContext);
CcRosVacbDecRefCount(current);
continue;
}
@@ -219,8 +219,8 @@
if (current->ReferenceCount > 2)
{
KeReleaseMutex(¤t->Mutex, FALSE);
- current->Bcb->Callbacks->ReleaseFromLazyWrite(
- current->Bcb->LazyWriteContext);
+ current->SharedCacheMap->Callbacks->ReleaseFromLazyWrite(
+ current->SharedCacheMap->LazyWriteContext);
CcRosVacbDecRefCount(current);
continue;
}
@@ -230,8 +230,8 @@
Status = CcRosFlushVacb(current);
KeReleaseMutex(¤t->Mutex, FALSE);
- current->Bcb->Callbacks->ReleaseFromLazyWrite(
- current->Bcb->LazyWriteContext);
+ current->SharedCacheMap->Callbacks->ReleaseFromLazyWrite(
+ current->SharedCacheMap->LazyWriteContext);
KeAcquireGuardedMutex(&ViewLock);
CcRosVacbDecRefCount(current);
@@ -296,7 +296,7 @@
VacbLruListEntry);
current_entry = current_entry->Flink;
- KeAcquireSpinLock(¤t->Bcb->BcbLock, &oldIrql);
+ KeAcquireSpinLock(¤t->SharedCacheMap->CacheMapLock,
&oldIrql);
/* Reference the VACB */
CcRosVacbIncRefCount(current);
@@ -305,7 +305,7 @@
if (current->MappedCount > 0 && !current->Dirty)
{
/* We have to break these locks because Cc sucks */
- KeReleaseSpinLock(¤t->Bcb->BcbLock, oldIrql);
+ KeReleaseSpinLock(¤t->SharedCacheMap->CacheMapLock,
oldIrql);
KeReleaseGuardedMutex(&ViewLock);
/* Page out the VACB */
@@ -318,7 +318,7 @@
/* Reacquire the locks */
KeAcquireGuardedMutex(&ViewLock);
- KeAcquireSpinLock(¤t->Bcb->BcbLock, &oldIrql);
+ KeAcquireSpinLock(¤t->SharedCacheMap->CacheMapLock,
&oldIrql);
}
/* Dereference the VACB */
@@ -330,10 +330,10 @@
ASSERT(!current->Dirty);
ASSERT(!current->MappedCount);
- RemoveEntryList(¤t->BcbVacbListEntry);
+ RemoveEntryList(¤t->CacheMapVacbListEntry);
RemoveEntryList(¤t->VacbListEntry);
RemoveEntryList(¤t->VacbLruListEntry);
- InsertHeadList(&FreeList, ¤t->BcbVacbListEntry);
+ InsertHeadList(&FreeList, ¤t->CacheMapVacbListEntry);
/* Calculate how many pages we freed for Mm */
PagesFreed = min(VACB_MAPPING_GRANULARITY / PAGE_SIZE, Target);
@@ -341,7 +341,7 @@
(*NrFreed) += PagesFreed;
}
- KeReleaseSpinLock(¤t->Bcb->BcbLock, oldIrql);
+ KeReleaseSpinLock(¤t->SharedCacheMap->CacheMapLock, oldIrql);
}
KeReleaseGuardedMutex(&ViewLock);
@@ -370,7 +370,7 @@
current_entry = RemoveHeadList(&FreeList);
current = CONTAINING_RECORD(current_entry,
ROS_VACB,
- BcbVacbListEntry);
+ CacheMapVacbListEntry);
CcRosInternalFreeVacb(current);
}
@@ -382,7 +382,7 @@
NTSTATUS
NTAPI
CcRosReleaseVacb (
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
PROS_VACB Vacb,
BOOLEAN Valid,
BOOLEAN Dirty,
@@ -391,13 +391,13 @@
BOOLEAN WasDirty;
KIRQL oldIrql;
- ASSERT(Bcb);
-
- DPRINT("CcRosReleaseVacb(Bcb 0x%p, Vacb 0x%p, Valid %u)\n",
- Bcb, Vacb, Valid);
-
- KeAcquireGuardedMutex(&ViewLock);
- KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql);
+ ASSERT(SharedCacheMap);
+
+ DPRINT("CcRosReleaseVacb(SharedCacheMap 0x%p, Vacb 0x%p, Valid %u)\n",
+ SharedCacheMap, Vacb, Valid);
+
+ KeAcquireGuardedMutex(&ViewLock);
+ KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);
Vacb->Valid = Valid;
@@ -424,7 +424,7 @@
CcRosVacbIncRefCount(Vacb);
}
- KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
KeReleaseGuardedMutex(&ViewLock);
KeReleaseMutex(&Vacb->Mutex, FALSE);
@@ -435,31 +435,32 @@
PROS_VACB
NTAPI
CcRosLookupVacb (
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset)
{
PLIST_ENTRY current_entry;
PROS_VACB current;
KIRQL oldIrql;
- ASSERT(Bcb);
-
- DPRINT("CcRosLookupVacb(Bcb -x%p, FileOffset %lu)\n", Bcb, FileOffset);
-
- KeAcquireGuardedMutex(&ViewLock);
- KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql);
-
- current_entry = Bcb->BcbVacbListHead.Flink;
- while (current_entry != &Bcb->BcbVacbListHead)
+ ASSERT(SharedCacheMap);
+
+ DPRINT("CcRosLookupVacb(SharedCacheMap 0x%p, FileOffset %lu)\n",
+ SharedCacheMap, FileOffset);
+
+ KeAcquireGuardedMutex(&ViewLock);
+ KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);
+
+ current_entry = SharedCacheMap->CacheMapVacbListHead.Flink;
+ while (current_entry != &SharedCacheMap->CacheMapVacbListHead)
{
current = CONTAINING_RECORD(current_entry,
ROS_VACB,
- BcbVacbListEntry);
+ CacheMapVacbListEntry);
if (IsPointInRange(current->FileOffset, VACB_MAPPING_GRANULARITY,
FileOffset))
{
CcRosVacbIncRefCount(current);
- KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
KeReleaseGuardedMutex(&ViewLock);
KeWaitForSingleObject(¤t->Mutex,
Executive,
@@ -473,7 +474,7 @@
current_entry = current_entry->Flink;
}
- KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
KeReleaseGuardedMutex(&ViewLock);
return NULL;
@@ -482,24 +483,25 @@
NTSTATUS
NTAPI
CcRosMarkDirtyVacb (
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset)
{
PROS_VACB Vacb;
KIRQL oldIrql;
- ASSERT(Bcb);
-
- DPRINT("CcRosMarkDirtyVacb(Bcb 0x%p, FileOffset %lu)\n", Bcb, FileOffset);
-
- Vacb = CcRosLookupVacb(Bcb, FileOffset);
+ ASSERT(SharedCacheMap);
+
+ DPRINT("CcRosMarkDirtyVacb(SharedCacheMap 0x%p, FileOffset %lu)\n",
+ SharedCacheMap, FileOffset);
+
+ Vacb = CcRosLookupVacb(SharedCacheMap, FileOffset);
if (Vacb == NULL)
{
KeBugCheck(CACHE_MANAGER);
}
KeAcquireGuardedMutex(&ViewLock);
- KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql);
+ KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);
if (!Vacb->Dirty)
{
@@ -517,7 +519,7 @@
Vacb->Dirty = TRUE;
- KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
KeReleaseGuardedMutex(&ViewLock);
KeReleaseMutex(&Vacb->Mutex, FALSE);
@@ -527,7 +529,7 @@
NTSTATUS
NTAPI
CcRosUnmapVacb (
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset,
BOOLEAN NowDirty)
{
@@ -535,19 +537,19 @@
BOOLEAN WasDirty;
KIRQL oldIrql;
- ASSERT(Bcb);
-
- DPRINT("CcRosUnmapVacb(Bcb 0x%p, FileOffset %lu, NowDirty %u)\n",
- Bcb, FileOffset, NowDirty);
-
- Vacb = CcRosLookupVacb(Bcb, FileOffset);
+ ASSERT(SharedCacheMap);
+
+ DPRINT("CcRosUnmapVacb(SharedCacheMap 0x%p, FileOffset %lu, NowDirty
%u)\n",
+ SharedCacheMap, FileOffset, NowDirty);
+
+ Vacb = CcRosLookupVacb(SharedCacheMap, FileOffset);
if (Vacb == NULL)
{
return STATUS_UNSUCCESSFUL;
}
KeAcquireGuardedMutex(&ViewLock);
- KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql);
+ KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);
WasDirty = Vacb->Dirty;
Vacb->Dirty = Vacb->Dirty || NowDirty;
@@ -570,7 +572,7 @@
CcRosVacbDecRefCount(Vacb);
}
- KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
KeReleaseGuardedMutex(&ViewLock);
KeReleaseMutex(&Vacb->Mutex, FALSE);
@@ -580,7 +582,7 @@
static
NTSTATUS
CcRosCreateVacb (
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset,
PROS_VACB *Vacb)
{
@@ -590,11 +592,11 @@
NTSTATUS Status;
KIRQL oldIrql;
- ASSERT(Bcb);
+ ASSERT(SharedCacheMap);
DPRINT("CcRosCreateVacb()\n");
- if (FileOffset >= Bcb->FileSize.u.LowPart)
+ if (FileOffset >= SharedCacheMap->FileSize.u.LowPart)
{
*Vacb = NULL;
return STATUS_INVALID_PARAMETER;
@@ -605,11 +607,11 @@
current->Dirty = FALSE;
current->PageOut = FALSE;
current->FileOffset = ROUND_DOWN(FileOffset, VACB_MAPPING_GRANULARITY);
- current->Bcb = Bcb;
+ current->SharedCacheMap = SharedCacheMap;
#if DBG
- if ( Bcb->Trace )
- {
- DPRINT1("CacheMap 0x%p: new VACB: 0x%p\n", Bcb, current );
+ if (SharedCacheMap->Trace)
+ {
+ DPRINT1("CacheMap 0x%p: new VACB: 0x%p\n", SharedCacheMap, current);
}
#endif
current->MappedCount = 0;
@@ -630,26 +632,26 @@
* file offset exist. If there is a VACB, we release
* our newly created VACB and return the existing one.
*/
- KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql);
- current_entry = Bcb->BcbVacbListHead.Flink;
+ KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);
+ current_entry = SharedCacheMap->CacheMapVacbListHead.Flink;
previous = NULL;
- while (current_entry != &Bcb->BcbVacbListHead)
+ while (current_entry != &SharedCacheMap->CacheMapVacbListHead)
{
current = CONTAINING_RECORD(current_entry,
ROS_VACB,
- BcbVacbListEntry);
+ CacheMapVacbListEntry);
if (IsPointInRange(current->FileOffset, VACB_MAPPING_GRANULARITY,
FileOffset))
{
CcRosVacbIncRefCount(current);
- KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
#if DBG
- if ( Bcb->Trace )
+ if (SharedCacheMap->Trace)
{
DPRINT1("CacheMap 0x%p: deleting newly created VACB 0x%p ( found
existing one 0x%p )\n",
- Bcb,
+ SharedCacheMap,
(*Vacb),
- current );
+ current);
}
#endif
KeReleaseMutex(&(*Vacb)->Mutex, FALSE);
@@ -677,13 +679,13 @@
current = *Vacb;
if (previous)
{
- InsertHeadList(&previous->BcbVacbListEntry,
¤t->BcbVacbListEntry);
+ InsertHeadList(&previous->CacheMapVacbListEntry,
¤t->CacheMapVacbListEntry);
}
else
{
- InsertHeadList(&Bcb->BcbVacbListHead, ¤t->BcbVacbListEntry);
- }
- KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
+ InsertHeadList(&SharedCacheMap->CacheMapVacbListHead,
¤t->CacheMapVacbListEntry);
+ }
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
InsertTailList(&VacbListHead, ¤t->VacbListEntry);
InsertTailList(&VacbLruListHead, ¤t->VacbLruListEntry);
KeReleaseGuardedMutex(&ViewLock);
@@ -710,9 +712,9 @@
#if MI_TRACE_PFNS
PWCHAR pos = NULL;
ULONG len = 0;
- if ((Bcb->FileObject) && (Bcb->FileObject->FileName.Buffer))
- {
- pos = wcsrchr(Bcb->FileObject->FileName.Buffer, '\\');
+ if ((SharedCacheMap->FileObject) &&
(SharedCacheMap->FileObject->FileName.Buffer))
+ {
+ pos = wcsrchr(SharedCacheMap->FileObject->FileName.Buffer, '\\');
len = wcslen(pos) * sizeof(WCHAR);
if (pos) snprintf(MI_PFN_CURRENT_PROCESS_NAME, min(16, len), "%S",
pos);
}
@@ -727,7 +729,7 @@
NTSTATUS
NTAPI
CcRosGetVacbChain (
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset,
ULONG Length,
PROS_VACB *Vacb)
@@ -737,7 +739,7 @@
PROS_VACB *VacbList;
PROS_VACB Previous = NULL;
- ASSERT(Bcb);
+ ASSERT(SharedCacheMap);
DPRINT("CcRosGetVacbChain()\n");
@@ -752,7 +754,7 @@
for (i = 0; i < (Length / VACB_MAPPING_GRANULARITY); i++)
{
ULONG CurrentOffset = FileOffset + (i * VACB_MAPPING_GRANULARITY);
- current = CcRosLookupVacb(Bcb, CurrentOffset);
+ current = CcRosLookupVacb(SharedCacheMap, CurrentOffset);
if (current != NULL)
{
KeAcquireGuardedMutex(&ViewLock);
@@ -767,7 +769,7 @@
}
else
{
- CcRosCreateVacb(Bcb, CurrentOffset, ¤t);
+ CcRosCreateVacb(SharedCacheMap, CurrentOffset, ¤t);
VacbList[i] = current;
}
}
@@ -794,7 +796,7 @@
NTSTATUS
NTAPI
CcRosGetVacb (
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset,
PULONG BaseOffset,
PVOID* BaseAddress,
@@ -804,20 +806,20 @@
PROS_VACB current;
NTSTATUS Status;
- ASSERT(Bcb);
+ ASSERT(SharedCacheMap);
DPRINT("CcRosGetVacb()\n");
/*
* Look for a VACB already mapping the same data.
*/
- current = CcRosLookupVacb(Bcb, FileOffset);
+ current = CcRosLookupVacb(SharedCacheMap, FileOffset);
if (current == NULL)
{
/*
* Otherwise create a new VACB.
*/
- Status = CcRosCreateVacb(Bcb, FileOffset, ¤t);
+ Status = CcRosCreateVacb(SharedCacheMap, FileOffset, ¤t);
if (!NT_SUCCESS(Status))
{
return Status;
@@ -846,18 +848,18 @@
NTSTATUS
NTAPI
CcRosRequestVacb (
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset,
PVOID* BaseAddress,
PBOOLEAN UptoDate,
PROS_VACB *Vacb)
/*
- * FUNCTION: Request a page mapping for a BCB
+ * FUNCTION: Request a page mapping for a shared cache map
*/
{
ULONG BaseOffset;
- ASSERT(Bcb);
+ ASSERT(SharedCacheMap);
if (FileOffset % VACB_MAPPING_GRANULARITY != 0)
{
@@ -866,7 +868,7 @@
KeBugCheck(CACHE_MANAGER);
}
- return CcRosGetVacb(Bcb,
+ return CcRosGetVacb(SharedCacheMap,
FileOffset,
&BaseOffset,
BaseAddress,
@@ -896,14 +898,14 @@
CcRosInternalFreeVacb (
PROS_VACB Vacb)
/*
- * FUNCTION: Releases a VACB associated with a BCB
+ * FUNCTION: Releases a VACB associated with a shared cache map
*/
{
DPRINT("Freeing VACB 0x%p\n", Vacb);
#if DBG
- if (Vacb->Bcb->Trace)
- {
- DPRINT1("CacheMap 0x%p: deleting VACB: 0x%p\n", Vacb->Bcb, Vacb);
+ if (Vacb->SharedCacheMap->Trace)
+ {
+ DPRINT1("CacheMap 0x%p: deleting VACB: 0x%p\n",
Vacb->SharedCacheMap, Vacb);
}
#endif
@@ -929,7 +931,7 @@
IN ULONG Length,
OUT PIO_STATUS_BLOCK IoStatus)
{
- PBCB Bcb;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
LARGE_INTEGER Offset;
PROS_VACB current;
NTSTATUS Status;
@@ -940,8 +942,8 @@
if (SectionObjectPointers && SectionObjectPointers->SharedCacheMap)
{
- Bcb = (PBCB)SectionObjectPointers->SharedCacheMap;
- ASSERT(Bcb);
+ SharedCacheMap = SectionObjectPointers->SharedCacheMap;
+ ASSERT(SharedCacheMap);
if (FileOffset)
{
Offset = *FileOffset;
@@ -949,7 +951,7 @@
else
{
Offset.QuadPart = (LONGLONG)0;
- Length = Bcb->FileSize.u.LowPart;
+ Length = SharedCacheMap->FileSize.u.LowPart;
}
if (IoStatus)
@@ -960,7 +962,7 @@
while (Length > 0)
{
- current = CcRosLookupVacb(Bcb, Offset.u.LowPart);
+ current = CcRosLookupVacb(SharedCacheMap, Offset.u.LowPart);
if (current != NULL)
{
if (current->Dirty)
@@ -974,9 +976,9 @@
KeReleaseMutex(¤t->Mutex, FALSE);
KeAcquireGuardedMutex(&ViewLock);
- KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql);
+ KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);
CcRosVacbDecRefCount(current);
- KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
KeReleaseGuardedMutex(&ViewLock);
}
@@ -1004,9 +1006,9 @@
NTAPI
CcRosDeleteFileCache (
PFILE_OBJECT FileObject,
- PBCB Bcb)
+ PROS_SHARED_CACHE_MAP SharedCacheMap)
/*
- * FUNCTION: Releases the BCB associated with a file object
+ * FUNCTION: Releases the shared cache map associated with a file object
*/
{
PLIST_ENTRY current_entry;
@@ -1014,16 +1016,16 @@
LIST_ENTRY FreeList;
KIRQL oldIrql;
- ASSERT(Bcb);
-
- Bcb->RefCount++;
+ ASSERT(SharedCacheMap);
+
+ SharedCacheMap->RefCount++;
KeReleaseGuardedMutex(&ViewLock);
CcFlushCache(FileObject->SectionObjectPointer, NULL, 0, NULL);
KeAcquireGuardedMutex(&ViewLock);
- Bcb->RefCount--;
- if (Bcb->RefCount == 0)
+ SharedCacheMap->RefCount--;
+ if (SharedCacheMap->RefCount == 0)
{
FileObject->SectionObjectPointer->SharedCacheMap = NULL;
@@ -1031,11 +1033,11 @@
* Release all VACBs
*/
InitializeListHead(&FreeList);
- KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql);
- while (!IsListEmpty(&Bcb->BcbVacbListHead))
- {
- current_entry = RemoveTailList(&Bcb->BcbVacbListHead);
- current = CONTAINING_RECORD(current_entry, ROS_VACB, BcbVacbListEntry);
+ KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);
+ while (!IsListEmpty(&SharedCacheMap->CacheMapVacbListHead))
+ {
+ current_entry =
RemoveTailList(&SharedCacheMap->CacheMapVacbListHead);
+ current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry);
RemoveEntryList(¤t->VacbListEntry);
RemoveEntryList(¤t->VacbLruListEntry);
if (current->Dirty)
@@ -1044,23 +1046,23 @@
DirtyPageCount -= VACB_MAPPING_GRANULARITY / PAGE_SIZE;
DPRINT1("Freeing dirty VACB\n");
}
- InsertHeadList(&FreeList, ¤t->BcbVacbListEntry);
+ InsertHeadList(&FreeList, ¤t->CacheMapVacbListEntry);
}
#if DBG
- Bcb->Trace = FALSE;
+ SharedCacheMap->Trace = FALSE;
#endif
- KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
+ KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
KeReleaseGuardedMutex(&ViewLock);
- ObDereferenceObject (Bcb->FileObject);
+ ObDereferenceObject(SharedCacheMap->FileObject);
while (!IsListEmpty(&FreeList))
{
current_entry = RemoveTailList(&FreeList);
- current = CONTAINING_RECORD(current_entry, ROS_VACB, BcbVacbListEntry);
+ current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry);
CcRosInternalFreeVacb(current);
}
- ExFreeToNPagedLookasideList(&BcbLookasideList, Bcb);
+ ExFreeToNPagedLookasideList(&SharedCacheMapLookasideList, SharedCacheMap);
KeAcquireGuardedMutex(&ViewLock);
}
return STATUS_SUCCESS;
@@ -1071,12 +1073,12 @@
CcRosReferenceCache (
PFILE_OBJECT FileObject)
{
- PBCB Bcb;
- KeAcquireGuardedMutex(&ViewLock);
- Bcb = (PBCB)FileObject->SectionObjectPointer->SharedCacheMap;
- ASSERT(Bcb);
- ASSERT(Bcb->RefCount != 0);
- Bcb->RefCount++;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
+ KeAcquireGuardedMutex(&ViewLock);
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
+ ASSERT(SharedCacheMap);
+ ASSERT(SharedCacheMap->RefCount != 0);
+ SharedCacheMap->RefCount++;
KeReleaseGuardedMutex(&ViewLock);
}
@@ -1085,13 +1087,13 @@
CcRosRemoveIfClosed (
PSECTION_OBJECT_POINTERS SectionObjectPointer)
{
- PBCB Bcb;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
DPRINT("CcRosRemoveIfClosed()\n");
KeAcquireGuardedMutex(&ViewLock);
- Bcb = (PBCB)SectionObjectPointer->SharedCacheMap;
- if (Bcb && Bcb->RefCount == 0)
- {
- CcRosDeleteFileCache(Bcb->FileObject, Bcb);
+ SharedCacheMap = SectionObjectPointer->SharedCacheMap;
+ if (SharedCacheMap && SharedCacheMap->RefCount == 0)
+ {
+ CcRosDeleteFileCache(SharedCacheMap->FileObject, SharedCacheMap);
}
KeReleaseGuardedMutex(&ViewLock);
}
@@ -1102,17 +1104,17 @@
CcRosDereferenceCache (
PFILE_OBJECT FileObject)
{
- PBCB Bcb;
- KeAcquireGuardedMutex(&ViewLock);
- Bcb = (PBCB)FileObject->SectionObjectPointer->SharedCacheMap;
- ASSERT(Bcb);
- if (Bcb->RefCount > 0)
- {
- Bcb->RefCount--;
- if (Bcb->RefCount == 0)
- {
- MmFreeSectionSegments(Bcb->FileObject);
- CcRosDeleteFileCache(FileObject, Bcb);
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
+ KeAcquireGuardedMutex(&ViewLock);
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
+ ASSERT(SharedCacheMap);
+ if (SharedCacheMap->RefCount > 0)
+ {
+ SharedCacheMap->RefCount--;
+ if (SharedCacheMap->RefCount == 0)
+ {
+ MmFreeSectionSegments(SharedCacheMap->FileObject);
+ CcRosDeleteFileCache(FileObject, SharedCacheMap);
}
}
KeReleaseGuardedMutex(&ViewLock);
@@ -1127,23 +1129,23 @@
* has been closed.
*/
{
- PBCB Bcb;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
KeAcquireGuardedMutex(&ViewLock);
if (FileObject->SectionObjectPointer->SharedCacheMap != NULL)
{
- Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
if (FileObject->PrivateCacheMap != NULL)
{
FileObject->PrivateCacheMap = NULL;
- if (Bcb->RefCount > 0)
+ if (SharedCacheMap->RefCount > 0)
{
- Bcb->RefCount--;
- if (Bcb->RefCount == 0)
+ SharedCacheMap->RefCount--;
+ if (SharedCacheMap->RefCount == 0)
{
- MmFreeSectionSegments(Bcb->FileObject);
- CcRosDeleteFileCache(FileObject, Bcb);
+ MmFreeSectionSegments(SharedCacheMap->FileObject);
+ CcRosDeleteFileCache(FileObject, SharedCacheMap);
}
}
}
@@ -1157,14 +1159,14 @@
CcTryToInitializeFileCache (
PFILE_OBJECT FileObject)
{
- PBCB Bcb;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
NTSTATUS Status;
KeAcquireGuardedMutex(&ViewLock);
ASSERT(FileObject->SectionObjectPointer);
- Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
- if (Bcb == NULL)
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
+ if (SharedCacheMap == NULL)
{
Status = STATUS_UNSUCCESSFUL;
}
@@ -1172,8 +1174,8 @@
{
if (FileObject->PrivateCacheMap == NULL)
{
- FileObject->PrivateCacheMap = Bcb;
- Bcb->RefCount++;
+ FileObject->PrivateCacheMap = SharedCacheMap;
+ SharedCacheMap->RefCount++;
}
Status = STATUS_SUCCESS;
}
@@ -1190,47 +1192,47 @@
PCACHE_MANAGER_CALLBACKS CallBacks,
PVOID LazyWriterContext)
/*
- * FUNCTION: Initializes a BCB for a file object
+ * FUNCTION: Initializes a shared cache map for a file object
*/
{
- PBCB Bcb;
-
- Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
- DPRINT("CcRosInitializeFileCache(FileObject 0x%p, Bcb 0x%p)\n",
- FileObject, Bcb);
-
- KeAcquireGuardedMutex(&ViewLock);
- if (Bcb == NULL)
- {
- Bcb = ExAllocateFromNPagedLookasideList(&BcbLookasideList);
- if (Bcb == NULL)
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
+
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
+ DPRINT("CcRosInitializeFileCache(FileObject 0x%p, SharedCacheMap 0x%p)\n",
+ FileObject, SharedCacheMap);
+
+ KeAcquireGuardedMutex(&ViewLock);
+ if (SharedCacheMap == NULL)
+ {
+ SharedCacheMap =
ExAllocateFromNPagedLookasideList(&SharedCacheMapLookasideList);
+ if (SharedCacheMap == NULL)
{
KeReleaseGuardedMutex(&ViewLock);
return STATUS_UNSUCCESSFUL;
}
- RtlZeroMemory(Bcb, sizeof(*Bcb));
+ RtlZeroMemory(SharedCacheMap, sizeof(*SharedCacheMap));
ObReferenceObjectByPointer(FileObject,
FILE_ALL_ACCESS,
NULL,
KernelMode);
- Bcb->FileObject = FileObject;
- Bcb->Callbacks = CallBacks;
- Bcb->LazyWriteContext = LazyWriterContext;
+ SharedCacheMap->FileObject = FileObject;
+ SharedCacheMap->Callbacks = CallBacks;
+ SharedCacheMap->LazyWriteContext = LazyWriterContext;
if (FileObject->FsContext)
{
- Bcb->AllocationSize =
+ SharedCacheMap->AllocationSize =
((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->AllocationSize;
- Bcb->FileSize =
+ SharedCacheMap->FileSize =
((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->FileSize;
}
- KeInitializeSpinLock(&Bcb->BcbLock);
- InitializeListHead(&Bcb->BcbVacbListHead);
- FileObject->SectionObjectPointer->SharedCacheMap = Bcb;
+ KeInitializeSpinLock(&SharedCacheMap->CacheMapLock);
+ InitializeListHead(&SharedCacheMap->CacheMapVacbListHead);
+ FileObject->SectionObjectPointer->SharedCacheMap = SharedCacheMap;
}
if (FileObject->PrivateCacheMap == NULL)
{
- FileObject->PrivateCacheMap = Bcb;
- Bcb->RefCount++;
+ FileObject->PrivateCacheMap = SharedCacheMap;
+ SharedCacheMap->RefCount++;
}
KeReleaseGuardedMutex(&ViewLock);
@@ -1245,12 +1247,12 @@
CcGetFileObjectFromSectionPtrs (
IN PSECTION_OBJECT_POINTERS SectionObjectPointers)
{
- PBCB Bcb;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
if (SectionObjectPointers && SectionObjectPointers->SharedCacheMap)
{
- Bcb = (PBCB)SectionObjectPointers->SharedCacheMap;
- ASSERT(Bcb);
- return Bcb->FileObject;
+ SharedCacheMap = SectionObjectPointers->SharedCacheMap;
+ ASSERT(SharedCacheMap);
+ return SharedCacheMap->FileObject;
}
return NULL;
}
@@ -1274,11 +1276,11 @@
sizeof(INTERNAL_BCB),
TAG_IBCB,
20);
- ExInitializeNPagedLookasideList (&BcbLookasideList,
+ ExInitializeNPagedLookasideList (&SharedCacheMapLookasideList,
NULL,
NULL,
0,
- sizeof(BCB),
+ sizeof(ROS_SHARED_CACHE_MAP),
TAG_BCB,
20);
ExInitializeNPagedLookasideList (&VacbLookasideList,
Modified: trunk/reactos/ntoskrnl/include/internal/cc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/cc.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/cc.h [iso-8859-1] Sat Apr 12 10:59:48 2014
@@ -101,21 +101,21 @@
LONG ActivePrefetches;
} PFSN_PREFETCHER_GLOBALS, *PPFSN_PREFETCHER_GLOBALS;
-typedef struct _BCB
-{
- LIST_ENTRY BcbVacbListHead;
+typedef struct _ROS_SHARED_CACHE_MAP
+{
+ LIST_ENTRY CacheMapVacbListHead;
ULONG TimeStamp;
PFILE_OBJECT FileObject;
LARGE_INTEGER AllocationSize;
LARGE_INTEGER FileSize;
PCACHE_MANAGER_CALLBACKS Callbacks;
PVOID LazyWriteContext;
- KSPIN_LOCK BcbLock;
+ KSPIN_LOCK CacheMapLock;
ULONG RefCount;
#if DBG
- BOOLEAN Trace; /* enable extra trace output for this BCB and it's VACBs */
+ BOOLEAN Trace; /* enable extra trace output for this cache map and it's VACBs */
#endif
-} BCB, *PBCB;
+} ROS_SHARED_CACHE_MAP, *PROS_SHARED_CACHE_MAP;
typedef struct _ROS_VACB
{
@@ -130,8 +130,8 @@
/* Page out in progress */
BOOLEAN PageOut;
ULONG MappedCount;
- /* Entry in the list of VACBs for this BCB. */
- LIST_ENTRY BcbVacbListEntry;
+ /* Entry in the list of VACBs for this shared cache map. */
+ LIST_ENTRY CacheMapVacbListEntry;
/* Entry in the list of VACBs which are dirty. */
LIST_ENTRY DirtyVacbListEntry;
/* Entry in the list of VACBs. */
@@ -143,8 +143,8 @@
KMUTEX Mutex;
/* Number of references. */
ULONG ReferenceCount;
- /* Pointer to the BCB for the file which this view maps data for. */
- PBCB Bcb;
+ /* Pointer to the shared cache map for the file which this view maps data for. */
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
/* Pointer to the next VACB in a chain. */
struct _ROS_VACB *NextInChain;
} ROS_VACB, *PROS_VACB;
@@ -185,7 +185,7 @@
NTSTATUS
NTAPI
CcRosGetVacb(
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset,
PULONG BaseOffset,
PVOID *BaseAddress,
@@ -212,7 +212,7 @@
NTSTATUS
NTAPI
CcRosUnmapVacb(
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset,
BOOLEAN NowDirty
);
@@ -220,14 +220,14 @@
PROS_VACB
NTAPI
CcRosLookupVacb(
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset
);
NTSTATUS
NTAPI
CcRosGetVacbChain(
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset,
ULONG Length,
PROS_VACB *Vacb
@@ -240,7 +240,7 @@
NTSTATUS
NTAPI
CcRosMarkDirtyVacb(
- PBCB Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset
);
@@ -267,7 +267,7 @@
NTSTATUS
NTAPI
CcRosReleaseVacb(
- BCB* Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
PROS_VACB Vacb,
BOOLEAN Valid,
BOOLEAN Dirty,
@@ -277,7 +277,7 @@
NTSTATUS
NTAPI
CcRosRequestVacb(
- BCB *Bcb,
+ PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset,
PVOID* BaseAddress,
PBOOLEAN UptoDate,
Modified: trunk/reactos/ntoskrnl/mm/section.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Sat Apr 12 10:59:48 2014
@@ -896,7 +896,7 @@
{
PFILE_OBJECT FileObject;
#ifndef NEWCC
- PBCB Bcb;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
#endif
SWAPENTRY SavedSwapEntry;
PFN_NUMBER Page;
@@ -918,10 +918,10 @@
(Offset->QuadPart + PAGE_SIZE <= Segment->RawLength.QuadPart ||
!IsImageSection))
{
NTSTATUS Status;
- Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
IsDirectMapped = TRUE;
#ifndef NEWCC
- Status = CcRosUnmapVacb(Bcb, FileOffset.LowPart, Dirty);
+ Status = CcRosUnmapVacb(SharedCacheMap, FileOffset.LowPart, Dirty);
#else
Status = STATUS_SUCCESS;
#endif
@@ -1015,13 +1015,13 @@
#ifndef NEWCC
if (!(MemoryArea->Data.SectionData.Segment->Image.Characteristics &
IMAGE_SCN_MEM_SHARED))
{
- PBCB Bcb;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
PROS_VACB Vacb;
- Bcb =
MemoryArea->Data.SectionData.Section->FileObject->SectionObjectPointer->SharedCacheMap;
- Vacb = CcRosLookupVacb(Bcb, (ULONG)(SegOffset +
MemoryArea->Data.SectionData.Segment->Image.FileOffset));
+ SharedCacheMap =
MemoryArea->Data.SectionData.Section->FileObject->SectionObjectPointer->SharedCacheMap;
+ Vacb = CcRosLookupVacb(SharedCacheMap, (ULONG)(SegOffset +
MemoryArea->Data.SectionData.Segment->Image.FileOffset));
if (Vacb)
{
- CcRosReleaseVacb(Bcb, Vacb, Vacb->Valid, FALSE, TRUE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, Vacb->Valid, FALSE, TRUE);
return TRUE;
}
}
@@ -1074,17 +1074,17 @@
PFILE_OBJECT FileObject;
NTSTATUS Status;
ULONG_PTR RawLength;
- PBCB Bcb;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
BOOLEAN IsImageSection;
ULONG_PTR Length;
FileObject = MemoryArea->Data.SectionData.Section->FileObject;
- Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
RawLength =
(ULONG_PTR)(MemoryArea->Data.SectionData.Segment->RawLength.QuadPart);
FileOffset = SegOffset +
MemoryArea->Data.SectionData.Segment->Image.FileOffset;
IsImageSection = MemoryArea->Data.SectionData.Section->AllocationAttributes
& SEC_IMAGE ? TRUE : FALSE;
- ASSERT(Bcb);
+ ASSERT(SharedCacheMap);
DPRINT("%S %I64x\n", FileObject->FileName.Buffer, FileOffset);
@@ -1103,7 +1103,7 @@
* filesystems do because it is safe for us to use an offset with an
* alignment less than the file system block size.
*/
- Status = CcRosGetVacb(Bcb,
+ Status = CcRosGetVacb(SharedCacheMap,
(ULONG)FileOffset,
&BaseOffset,
&BaseAddress,
@@ -1122,7 +1122,7 @@
Status = CcReadVirtualAddress(Vacb);
if (!NT_SUCCESS(Status))
{
- CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE);
return Status;
}
}
@@ -1136,7 +1136,7 @@
(*Page) = MmGetPhysicalAddress((char*)BaseAddress +
FileOffset - BaseOffset).LowPart >>
PAGE_SHIFT;
- CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, TRUE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, TRUE);
}
else
{
@@ -1156,7 +1156,7 @@
{
return(Status);
}
- Status = CcRosGetVacb(Bcb,
+ Status = CcRosGetVacb(SharedCacheMap,
(ULONG)FileOffset,
&BaseOffset,
&BaseAddress,
@@ -1175,7 +1175,7 @@
Status = CcReadVirtualAddress(Vacb);
if (!NT_SUCCESS(Status))
{
- CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE);
return Status;
}
}
@@ -1196,8 +1196,8 @@
{
memcpy(PageAddr, (char*)BaseAddress + FileOffset - BaseOffset, VacbOffset);
MiUnmapPageInHyperSpace(Process, PageAddr, Irql);
- CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, FALSE);
- Status = CcRosGetVacb(Bcb,
+ CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
+ Status = CcRosGetVacb(SharedCacheMap,
(ULONG)(FileOffset + VacbOffset),
&BaseOffset,
&BaseAddress,
@@ -1216,7 +1216,7 @@
Status = CcReadVirtualAddress(Vacb);
if (!NT_SUCCESS(Status))
{
- CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE);
return Status;
}
}
@@ -1231,7 +1231,7 @@
}
}
MiUnmapPageInHyperSpace(Process, PageAddr, Irql);
- CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, FALSE);
+ CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
}
return(STATUS_SUCCESS);
}
@@ -1869,7 +1869,7 @@
NTSTATUS Status;
PFILE_OBJECT FileObject;
#ifndef NEWCC
- PBCB Bcb = NULL;
+ PROS_SHARED_CACHE_MAP SharedCacheMap = NULL;
#endif
BOOLEAN DirectMapped;
BOOLEAN IsImageSection;
@@ -1901,7 +1901,7 @@
if (FileObject != NULL &&
!(Context.Segment->Image.Characteristics & IMAGE_SCN_MEM_SHARED))
{
- Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
/*
* If the file system is letting us go directly to the cache and the
@@ -2066,7 +2066,7 @@
KeBugCheckEx(MEMORY_MANAGEMENT, STATUS_UNSUCCESSFUL, SwapEntry,
(ULONG_PTR)Process, (ULONG_PTR)Address);
}
#ifndef NEWCC
- Status = CcRosUnmapVacb(Bcb, (ULONG)FileOffset, FALSE);
+ Status = CcRosUnmapVacb(SharedCacheMap, (ULONG)FileOffset, FALSE);
#else
Status = STATUS_SUCCESS;
#endif
@@ -2074,7 +2074,7 @@
if (!NT_SUCCESS(Status))
{
DPRINT1("CcRosUnmapVacb failed, status = %x\n", Status);
- KeBugCheckEx(MEMORY_MANAGEMENT, Status, (ULONG_PTR)Bcb, (ULONG_PTR)FileOffset,
(ULONG_PTR)Address);
+ KeBugCheckEx(MEMORY_MANAGEMENT, Status, (ULONG_PTR)SharedCacheMap,
(ULONG_PTR)FileOffset, (ULONG_PTR)Address);
}
#endif
MiSetPageEvent(NULL, NULL);
@@ -2276,7 +2276,7 @@
BOOLEAN Private;
NTSTATUS Status;
PFILE_OBJECT FileObject;
- PBCB Bcb = NULL;
+ PROS_SHARED_CACHE_MAP SharedCacheMap = NULL;
BOOLEAN DirectMapped;
BOOLEAN IsImageSection;
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
@@ -2298,7 +2298,7 @@
if (FileObject != NULL &&
!(Segment->Image.Characteristics & IMAGE_SCN_MEM_SHARED))
{
- Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
/*
* If the file system is letting us go directly to the cache and the
@@ -2366,7 +2366,7 @@
ASSERT(SwapEntry == 0);
//SOffset.QuadPart = Offset.QuadPart + Segment->Image.FileOffset;
#ifndef NEWCC
- CcRosMarkDirtyVacb(Bcb, Offset.LowPart);
+ CcRosMarkDirtyVacb(SharedCacheMap, Offset.LowPart);
#endif
MmLockSectionSegment(Segment);
MmSetPageEntrySectionSegment(Segment, &Offset, PageEntry);
@@ -3970,7 +3970,7 @@
{
ULONG_PTR Entry;
PFILE_OBJECT FileObject;
- PBCB Bcb;
+ PROS_SHARED_CACHE_MAP SharedCacheMap;
LARGE_INTEGER Offset;
SWAPENTRY SavedSwapEntry;
PROS_SECTION_OBJECT Section;
@@ -4011,9 +4011,9 @@
if (Page == PFN_FROM_SSE(Entry) && Dirty)
{
FileObject = MemoryArea->Data.SectionData.Section->FileObject;
- Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
+ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
#ifndef NEWCC
- CcRosMarkDirtyVacb(Bcb, (ULONG)(Offset.QuadPart +
Segment->Image.FileOffset));
+ CcRosMarkDirtyVacb(SharedCacheMap, (ULONG)(Offset.QuadPart +
Segment->Image.FileOffset));
#endif
ASSERT(SwapEntry == 0);
}
@@ -4674,8 +4674,8 @@
/* Check size of file */
if (SectionObjectPointer->SharedCacheMap)
{
- PBCB Bcb = SectionObjectPointer->SharedCacheMap;
- if (NewFileSize->QuadPart <= Bcb->FileSize.QuadPart)
+ PROS_SHARED_CACHE_MAP SharedCacheMap =
SectionObjectPointer->SharedCacheMap;
+ if (NewFileSize->QuadPart <= SharedCacheMap->FileSize.QuadPart)
{
return FALSE;
}