mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 06:55:55 +00:00
[NTOS:CC]
- Change ROS_VACB::FileOffset from ULONG to LARGE_INTEGER svn path=/trunk/; revision=62716
This commit is contained in:
parent
340e5bb756
commit
417fb8210e
5 changed files with 34 additions and 35 deletions
|
@ -66,7 +66,6 @@ ReadVacbChain (
|
||||||
PROS_VACB current;
|
PROS_VACB current;
|
||||||
PROS_VACB previous;
|
PROS_VACB previous;
|
||||||
IO_STATUS_BLOCK Iosb;
|
IO_STATUS_BLOCK Iosb;
|
||||||
LARGE_INTEGER VacbOffset;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG TempLength;
|
ULONG TempLength;
|
||||||
KEVENT Event;
|
KEVENT Event;
|
||||||
|
@ -141,11 +140,10 @@ ReadVacbChain (
|
||||||
/*
|
/*
|
||||||
* Read in the information.
|
* Read in the information.
|
||||||
*/
|
*/
|
||||||
VacbOffset.QuadPart = current->FileOffset;
|
|
||||||
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
||||||
Status = IoPageRead(SharedCacheMap->FileObject,
|
Status = IoPageRead(SharedCacheMap->FileObject,
|
||||||
Mdl,
|
Mdl,
|
||||||
&VacbOffset,
|
¤t->FileOffset,
|
||||||
&Event,
|
&Event,
|
||||||
&Iosb);
|
&Iosb);
|
||||||
if (Status == STATUS_PENDING)
|
if (Status == STATUS_PENDING)
|
||||||
|
@ -194,12 +192,10 @@ CcReadVirtualAddress (
|
||||||
ULONG Size;
|
ULONG Size;
|
||||||
PMDL Mdl;
|
PMDL Mdl;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
LARGE_INTEGER VacbOffset;
|
|
||||||
IO_STATUS_BLOCK IoStatus;
|
IO_STATUS_BLOCK IoStatus;
|
||||||
KEVENT Event;
|
KEVENT Event;
|
||||||
|
|
||||||
VacbOffset.QuadPart = Vacb->FileOffset;
|
Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart - Vacb->FileOffset.QuadPart);
|
||||||
Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart - Vacb->FileOffset);
|
|
||||||
if (Size > VACB_MAPPING_GRANULARITY)
|
if (Size > VACB_MAPPING_GRANULARITY)
|
||||||
{
|
{
|
||||||
Size = VACB_MAPPING_GRANULARITY;
|
Size = VACB_MAPPING_GRANULARITY;
|
||||||
|
@ -214,7 +210,7 @@ CcReadVirtualAddress (
|
||||||
MmBuildMdlForNonPagedPool(Mdl);
|
MmBuildMdlForNonPagedPool(Mdl);
|
||||||
Mdl->MdlFlags |= MDL_IO_PAGE_READ;
|
Mdl->MdlFlags |= MDL_IO_PAGE_READ;
|
||||||
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
||||||
Status = IoPageRead(Vacb->SharedCacheMap->FileObject, Mdl, &VacbOffset, &Event, &IoStatus);
|
Status = IoPageRead(Vacb->SharedCacheMap->FileObject, Mdl, &Vacb->FileOffset, &Event, &IoStatus);
|
||||||
if (Status == STATUS_PENDING)
|
if (Status == STATUS_PENDING)
|
||||||
{
|
{
|
||||||
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
||||||
|
@ -247,12 +243,10 @@ CcWriteVirtualAddress (
|
||||||
PMDL Mdl;
|
PMDL Mdl;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
IO_STATUS_BLOCK IoStatus;
|
IO_STATUS_BLOCK IoStatus;
|
||||||
LARGE_INTEGER VacbOffset;
|
|
||||||
KEVENT Event;
|
KEVENT Event;
|
||||||
|
|
||||||
Vacb->Dirty = FALSE;
|
Vacb->Dirty = FALSE;
|
||||||
VacbOffset.QuadPart = Vacb->FileOffset;
|
Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart - Vacb->FileOffset.QuadPart);
|
||||||
Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart - Vacb->FileOffset);
|
|
||||||
if (Size > VACB_MAPPING_GRANULARITY)
|
if (Size > VACB_MAPPING_GRANULARITY)
|
||||||
{
|
{
|
||||||
Size = VACB_MAPPING_GRANULARITY;
|
Size = VACB_MAPPING_GRANULARITY;
|
||||||
|
@ -277,7 +271,7 @@ CcWriteVirtualAddress (
|
||||||
MmBuildMdlForNonPagedPool(Mdl);
|
MmBuildMdlForNonPagedPool(Mdl);
|
||||||
Mdl->MdlFlags |= MDL_IO_PAGE_READ;
|
Mdl->MdlFlags |= MDL_IO_PAGE_READ;
|
||||||
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
||||||
Status = IoSynchronousPageWrite(Vacb->SharedCacheMap->FileObject, Mdl, &VacbOffset, &Event, &IoStatus);
|
Status = IoSynchronousPageWrite(Vacb->SharedCacheMap->FileObject, Mdl, &Vacb->FileOffset, &Event, &IoStatus);
|
||||||
if (Status == STATUS_PENDING)
|
if (Status == STATUS_PENDING)
|
||||||
{
|
{
|
||||||
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
||||||
|
@ -364,7 +358,8 @@ CcCopyRead (
|
||||||
ROS_VACB,
|
ROS_VACB,
|
||||||
CacheMapVacbListEntry);
|
CacheMapVacbListEntry);
|
||||||
if (!current->Valid &&
|
if (!current->Valid &&
|
||||||
DoRangesIntersect(current->FileOffset, VACB_MAPPING_GRANULARITY,
|
DoRangesIntersect(current->FileOffset.QuadPart,
|
||||||
|
VACB_MAPPING_GRANULARITY,
|
||||||
ReadOffset, Length))
|
ReadOffset, Length))
|
||||||
{
|
{
|
||||||
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
|
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
|
||||||
|
@ -372,7 +367,7 @@ CcCopyRead (
|
||||||
IoStatus->Information = 0;
|
IoStatus->Information = 0;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (current->FileOffset >= ReadOffset + Length)
|
if (current->FileOffset.QuadPart >= ReadOffset + Length)
|
||||||
break;
|
break;
|
||||||
current_entry = current_entry->Flink;
|
current_entry = current_entry->Flink;
|
||||||
}
|
}
|
||||||
|
@ -482,14 +477,15 @@ CcCopyWrite (
|
||||||
ROS_VACB,
|
ROS_VACB,
|
||||||
CacheMapVacbListEntry);
|
CacheMapVacbListEntry);
|
||||||
if (!Vacb->Valid &&
|
if (!Vacb->Valid &&
|
||||||
DoRangesIntersect(Vacb->FileOffset, VACB_MAPPING_GRANULARITY,
|
DoRangesIntersect(Vacb->FileOffset.QuadPart,
|
||||||
|
VACB_MAPPING_GRANULARITY,
|
||||||
WriteOffset, Length))
|
WriteOffset, Length))
|
||||||
{
|
{
|
||||||
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
|
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
|
||||||
/* datas not available */
|
/* datas not available */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (Vacb->FileOffset >= WriteOffset + Length)
|
if (Vacb->FileOffset.QuadPart >= WriteOffset + Length)
|
||||||
break;
|
break;
|
||||||
current_entry = current_entry->Flink;
|
current_entry = current_entry->Flink;
|
||||||
}
|
}
|
||||||
|
@ -704,14 +700,15 @@ CcZeroData (
|
||||||
ROS_VACB,
|
ROS_VACB,
|
||||||
CacheMapVacbListEntry);
|
CacheMapVacbListEntry);
|
||||||
if (!Vacb->Valid &&
|
if (!Vacb->Valid &&
|
||||||
DoRangesIntersect(Vacb->FileOffset, VACB_MAPPING_GRANULARITY,
|
DoRangesIntersect(Vacb->FileOffset.QuadPart,
|
||||||
|
VACB_MAPPING_GRANULARITY,
|
||||||
WriteOffset.u.LowPart, Length))
|
WriteOffset.u.LowPart, Length))
|
||||||
{
|
{
|
||||||
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
|
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
|
||||||
/* datas not available */
|
/* datas not available */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (Vacb->FileOffset >= WriteOffset.u.LowPart + Length)
|
if (Vacb->FileOffset.QuadPart >= WriteOffset.u.LowPart + Length)
|
||||||
break;
|
break;
|
||||||
current_entry = current_entry->Flink;
|
current_entry = current_entry->Flink;
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,7 +163,7 @@ CcSetFileSizes (
|
||||||
ROS_VACB,
|
ROS_VACB,
|
||||||
CacheMapVacbListEntry);
|
CacheMapVacbListEntry);
|
||||||
current_entry = current_entry->Flink;
|
current_entry = current_entry->Flink;
|
||||||
if (current->FileOffset >= FileSizes->AllocationSize.QuadPart)
|
if (current->FileOffset.QuadPart >= FileSizes->AllocationSize.QuadPart)
|
||||||
{
|
{
|
||||||
if ((current->ReferenceCount == 0) || ((current->ReferenceCount == 1) && current->Dirty))
|
if ((current->ReferenceCount == 0) || ((current->ReferenceCount == 1) && current->Dirty))
|
||||||
{
|
{
|
||||||
|
|
|
@ -456,7 +456,8 @@ CcRosLookupVacb (
|
||||||
current = CONTAINING_RECORD(current_entry,
|
current = CONTAINING_RECORD(current_entry,
|
||||||
ROS_VACB,
|
ROS_VACB,
|
||||||
CacheMapVacbListEntry);
|
CacheMapVacbListEntry);
|
||||||
if (IsPointInRange(current->FileOffset, VACB_MAPPING_GRANULARITY,
|
if (IsPointInRange(current->FileOffset.QuadPart,
|
||||||
|
VACB_MAPPING_GRANULARITY,
|
||||||
FileOffset))
|
FileOffset))
|
||||||
{
|
{
|
||||||
CcRosVacbIncRefCount(current);
|
CcRosVacbIncRefCount(current);
|
||||||
|
@ -469,7 +470,7 @@ CcRosLookupVacb (
|
||||||
NULL);
|
NULL);
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
if (current->FileOffset > FileOffset)
|
if (current->FileOffset.QuadPart > FileOffset)
|
||||||
break;
|
break;
|
||||||
current_entry = current_entry->Flink;
|
current_entry = current_entry->Flink;
|
||||||
}
|
}
|
||||||
|
@ -606,7 +607,7 @@ CcRosCreateVacb (
|
||||||
current->Valid = FALSE;
|
current->Valid = FALSE;
|
||||||
current->Dirty = FALSE;
|
current->Dirty = FALSE;
|
||||||
current->PageOut = FALSE;
|
current->PageOut = FALSE;
|
||||||
current->FileOffset = ROUND_DOWN(FileOffset, VACB_MAPPING_GRANULARITY);
|
current->FileOffset.QuadPart = ROUND_DOWN(FileOffset, VACB_MAPPING_GRANULARITY);
|
||||||
current->SharedCacheMap = SharedCacheMap;
|
current->SharedCacheMap = SharedCacheMap;
|
||||||
#if DBG
|
#if DBG
|
||||||
if (SharedCacheMap->Trace)
|
if (SharedCacheMap->Trace)
|
||||||
|
@ -640,7 +641,8 @@ CcRosCreateVacb (
|
||||||
current = CONTAINING_RECORD(current_entry,
|
current = CONTAINING_RECORD(current_entry,
|
||||||
ROS_VACB,
|
ROS_VACB,
|
||||||
CacheMapVacbListEntry);
|
CacheMapVacbListEntry);
|
||||||
if (IsPointInRange(current->FileOffset, VACB_MAPPING_GRANULARITY,
|
if (IsPointInRange(current->FileOffset.QuadPart,
|
||||||
|
VACB_MAPPING_GRANULARITY,
|
||||||
FileOffset))
|
FileOffset))
|
||||||
{
|
{
|
||||||
CcRosVacbIncRefCount(current);
|
CcRosVacbIncRefCount(current);
|
||||||
|
@ -665,13 +667,13 @@ CcRosCreateVacb (
|
||||||
NULL);
|
NULL);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
if (current->FileOffset < FileOffset)
|
if (current->FileOffset.QuadPart < FileOffset)
|
||||||
{
|
{
|
||||||
ASSERT(previous == NULL ||
|
ASSERT(previous == NULL ||
|
||||||
previous->FileOffset < current->FileOffset);
|
previous->FileOffset.QuadPart < current->FileOffset.QuadPart);
|
||||||
previous = current;
|
previous = current;
|
||||||
}
|
}
|
||||||
if (current->FileOffset > FileOffset)
|
if (current->FileOffset.QuadPart > FileOffset)
|
||||||
break;
|
break;
|
||||||
current_entry = current_entry->Flink;
|
current_entry = current_entry->Flink;
|
||||||
}
|
}
|
||||||
|
@ -798,7 +800,7 @@ NTAPI
|
||||||
CcRosGetVacb (
|
CcRosGetVacb (
|
||||||
PROS_SHARED_CACHE_MAP SharedCacheMap,
|
PROS_SHARED_CACHE_MAP SharedCacheMap,
|
||||||
ULONG FileOffset,
|
ULONG FileOffset,
|
||||||
PULONG BaseOffset,
|
PULONGLONG BaseOffset,
|
||||||
PVOID* BaseAddress,
|
PVOID* BaseAddress,
|
||||||
PBOOLEAN UptoDate,
|
PBOOLEAN UptoDate,
|
||||||
PROS_VACB *Vacb)
|
PROS_VACB *Vacb)
|
||||||
|
@ -841,7 +843,7 @@ CcRosGetVacb (
|
||||||
*BaseAddress = current->BaseAddress;
|
*BaseAddress = current->BaseAddress;
|
||||||
DPRINT("*BaseAddress %p\n", *BaseAddress);
|
DPRINT("*BaseAddress %p\n", *BaseAddress);
|
||||||
*Vacb = current;
|
*Vacb = current;
|
||||||
*BaseOffset = current->FileOffset;
|
*BaseOffset = current->FileOffset.QuadPart;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -857,7 +859,7 @@ CcRosRequestVacb (
|
||||||
* FUNCTION: Request a page mapping for a shared cache map
|
* FUNCTION: Request a page mapping for a shared cache map
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
ULONG BaseOffset;
|
ULONGLONG BaseOffset;
|
||||||
|
|
||||||
ASSERT(SharedCacheMap);
|
ASSERT(SharedCacheMap);
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ typedef struct _ROS_VACB
|
||||||
LIST_ENTRY VacbListEntry;
|
LIST_ENTRY VacbListEntry;
|
||||||
LIST_ENTRY VacbLruListEntry;
|
LIST_ENTRY VacbLruListEntry;
|
||||||
/* Offset in the file which this view maps. */
|
/* Offset in the file which this view maps. */
|
||||||
ULONG FileOffset;
|
LARGE_INTEGER FileOffset;
|
||||||
/* Mutex */
|
/* Mutex */
|
||||||
KMUTEX Mutex;
|
KMUTEX Mutex;
|
||||||
/* Number of references. */
|
/* Number of references. */
|
||||||
|
@ -187,7 +187,7 @@ NTAPI
|
||||||
CcRosGetVacb(
|
CcRosGetVacb(
|
||||||
PROS_SHARED_CACHE_MAP SharedCacheMap,
|
PROS_SHARED_CACHE_MAP SharedCacheMap,
|
||||||
ULONG FileOffset,
|
ULONG FileOffset,
|
||||||
PULONG BaseOffset,
|
PULONGLONG BaseOffset,
|
||||||
PVOID *BaseAddress,
|
PVOID *BaseAddress,
|
||||||
PBOOLEAN UptoDate,
|
PBOOLEAN UptoDate,
|
||||||
PROS_VACB *Vacb
|
PROS_VACB *Vacb
|
||||||
|
@ -305,9 +305,9 @@ CcTryToInitializeFileCache(PFILE_OBJECT FileObject);
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
DoRangesIntersect(
|
DoRangesIntersect(
|
||||||
_In_ ULONG Offset1,
|
_In_ ULONGLONG Offset1,
|
||||||
_In_ ULONG Length1,
|
_In_ ULONG Length1,
|
||||||
_In_ ULONG Offset2,
|
_In_ ULONGLONG Offset2,
|
||||||
_In_ ULONG Length2)
|
_In_ ULONG Length2)
|
||||||
{
|
{
|
||||||
if (Offset1 + Length1 <= Offset2)
|
if (Offset1 + Length1 <= Offset2)
|
||||||
|
@ -320,9 +320,9 @@ DoRangesIntersect(
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
IsPointInRange(
|
IsPointInRange(
|
||||||
_In_ ULONG Offset1,
|
_In_ ULONGLONG Offset1,
|
||||||
_In_ ULONG Length1,
|
_In_ ULONG Length1,
|
||||||
_In_ ULONG Point)
|
_In_ ULONGLONG Point)
|
||||||
{
|
{
|
||||||
return DoRangesIntersect(Offset1, Length1, Point, 1);
|
return DoRangesIntersect(Offset1, Length1, Point, 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1066,7 +1066,7 @@ MiReadPage(PMEMORY_AREA MemoryArea,
|
||||||
* Page - Variable that receives a page contains the read data.
|
* Page - Variable that receives a page contains the read data.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
ULONG BaseOffset;
|
ULONGLONG BaseOffset;
|
||||||
ULONGLONG FileOffset;
|
ULONGLONG FileOffset;
|
||||||
PVOID BaseAddress;
|
PVOID BaseAddress;
|
||||||
BOOLEAN UptoDate;
|
BOOLEAN UptoDate;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue