Author: tfaber
Date: Sat Apr 12 11:51:46 2014
New Revision: 62716
URL:
http://svn.reactos.org/svn/reactos?rev=62716&view=rev
Log:
[NTOS:CC]
- Change ROS_VACB::FileOffset from ULONG to LARGE_INTEGER
Modified:
trunk/reactos/ntoskrnl/cc/copy.c
trunk/reactos/ntoskrnl/cc/fs.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 11:51:46 2014
@@ -66,7 +66,6 @@
PROS_VACB current;
PROS_VACB previous;
IO_STATUS_BLOCK Iosb;
- LARGE_INTEGER VacbOffset;
NTSTATUS Status;
ULONG TempLength;
KEVENT Event;
@@ -141,11 +140,10 @@
/*
* Read in the information.
*/
- VacbOffset.QuadPart = current->FileOffset;
KeInitializeEvent(&Event, NotificationEvent, FALSE);
Status = IoPageRead(SharedCacheMap->FileObject,
Mdl,
- &VacbOffset,
+ ¤t->FileOffset,
&Event,
&Iosb);
if (Status == STATUS_PENDING)
@@ -194,12 +192,10 @@
ULONG Size;
PMDL Mdl;
NTSTATUS Status;
- LARGE_INTEGER VacbOffset;
IO_STATUS_BLOCK IoStatus;
KEVENT Event;
- VacbOffset.QuadPart = Vacb->FileOffset;
- Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart -
Vacb->FileOffset);
+ Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart -
Vacb->FileOffset.QuadPart);
if (Size > VACB_MAPPING_GRANULARITY)
{
Size = VACB_MAPPING_GRANULARITY;
@@ -214,7 +210,7 @@
MmBuildMdlForNonPagedPool(Mdl);
Mdl->MdlFlags |= MDL_IO_PAGE_READ;
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)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@@ -247,12 +243,10 @@
PMDL Mdl;
NTSTATUS Status;
IO_STATUS_BLOCK IoStatus;
- LARGE_INTEGER VacbOffset;
KEVENT Event;
Vacb->Dirty = FALSE;
- VacbOffset.QuadPart = Vacb->FileOffset;
- Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart -
Vacb->FileOffset);
+ Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart -
Vacb->FileOffset.QuadPart);
if (Size > VACB_MAPPING_GRANULARITY)
{
Size = VACB_MAPPING_GRANULARITY;
@@ -277,7 +271,7 @@
MmBuildMdlForNonPagedPool(Mdl);
Mdl->MdlFlags |= MDL_IO_PAGE_READ;
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)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@@ -364,7 +358,8 @@
ROS_VACB,
CacheMapVacbListEntry);
if (!current->Valid &&
- DoRangesIntersect(current->FileOffset, VACB_MAPPING_GRANULARITY,
+ DoRangesIntersect(current->FileOffset.QuadPart,
+ VACB_MAPPING_GRANULARITY,
ReadOffset, Length))
{
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
@@ -372,7 +367,7 @@
IoStatus->Information = 0;
return FALSE;
}
- if (current->FileOffset >= ReadOffset + Length)
+ if (current->FileOffset.QuadPart >= ReadOffset + Length)
break;
current_entry = current_entry->Flink;
}
@@ -482,14 +477,15 @@
ROS_VACB,
CacheMapVacbListEntry);
if (!Vacb->Valid &&
- DoRangesIntersect(Vacb->FileOffset, VACB_MAPPING_GRANULARITY,
+ DoRangesIntersect(Vacb->FileOffset.QuadPart,
+ VACB_MAPPING_GRANULARITY,
WriteOffset, Length))
{
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
/* datas not available */
return FALSE;
}
- if (Vacb->FileOffset >= WriteOffset + Length)
+ if (Vacb->FileOffset.QuadPart >= WriteOffset + Length)
break;
current_entry = current_entry->Flink;
}
@@ -704,14 +700,15 @@
ROS_VACB,
CacheMapVacbListEntry);
if (!Vacb->Valid &&
- DoRangesIntersect(Vacb->FileOffset, VACB_MAPPING_GRANULARITY,
+ DoRangesIntersect(Vacb->FileOffset.QuadPart,
+ VACB_MAPPING_GRANULARITY,
WriteOffset.u.LowPart, Length))
{
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql);
/* datas not available */
return FALSE;
}
- if (Vacb->FileOffset >= WriteOffset.u.LowPart + Length)
+ if (Vacb->FileOffset.QuadPart >= WriteOffset.u.LowPart + Length)
break;
current_entry = current_entry->Flink;
}
Modified: trunk/reactos/ntoskrnl/cc/fs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/fs.c?rev=62716…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/fs.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/fs.c [iso-8859-1] Sat Apr 12 11:51:46 2014
@@ -163,7 +163,7 @@
ROS_VACB,
CacheMapVacbListEntry);
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))
{
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 11:51:46 2014
@@ -456,7 +456,8 @@
current = CONTAINING_RECORD(current_entry,
ROS_VACB,
CacheMapVacbListEntry);
- if (IsPointInRange(current->FileOffset, VACB_MAPPING_GRANULARITY,
+ if (IsPointInRange(current->FileOffset.QuadPart,
+ VACB_MAPPING_GRANULARITY,
FileOffset))
{
CcRosVacbIncRefCount(current);
@@ -469,7 +470,7 @@
NULL);
return current;
}
- if (current->FileOffset > FileOffset)
+ if (current->FileOffset.QuadPart > FileOffset)
break;
current_entry = current_entry->Flink;
}
@@ -606,7 +607,7 @@
current->Valid = FALSE;
current->Dirty = FALSE;
current->PageOut = FALSE;
- current->FileOffset = ROUND_DOWN(FileOffset, VACB_MAPPING_GRANULARITY);
+ current->FileOffset.QuadPart = ROUND_DOWN(FileOffset, VACB_MAPPING_GRANULARITY);
current->SharedCacheMap = SharedCacheMap;
#if DBG
if (SharedCacheMap->Trace)
@@ -640,7 +641,8 @@
current = CONTAINING_RECORD(current_entry,
ROS_VACB,
CacheMapVacbListEntry);
- if (IsPointInRange(current->FileOffset, VACB_MAPPING_GRANULARITY,
+ if (IsPointInRange(current->FileOffset.QuadPart,
+ VACB_MAPPING_GRANULARITY,
FileOffset))
{
CcRosVacbIncRefCount(current);
@@ -665,13 +667,13 @@
NULL);
return STATUS_SUCCESS;
}
- if (current->FileOffset < FileOffset)
+ if (current->FileOffset.QuadPart < FileOffset)
{
ASSERT(previous == NULL ||
- previous->FileOffset < current->FileOffset);
+ previous->FileOffset.QuadPart <
current->FileOffset.QuadPart);
previous = current;
}
- if (current->FileOffset > FileOffset)
+ if (current->FileOffset.QuadPart > FileOffset)
break;
current_entry = current_entry->Flink;
}
@@ -798,7 +800,7 @@
CcRosGetVacb (
PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset,
- PULONG BaseOffset,
+ PULONGLONG BaseOffset,
PVOID* BaseAddress,
PBOOLEAN UptoDate,
PROS_VACB *Vacb)
@@ -841,7 +843,7 @@
*BaseAddress = current->BaseAddress;
DPRINT("*BaseAddress %p\n", *BaseAddress);
*Vacb = current;
- *BaseOffset = current->FileOffset;
+ *BaseOffset = current->FileOffset.QuadPart;
return STATUS_SUCCESS;
}
@@ -857,7 +859,7 @@
* FUNCTION: Request a page mapping for a shared cache map
*/
{
- ULONG BaseOffset;
+ ULONGLONG BaseOffset;
ASSERT(SharedCacheMap);
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 11:51:46 2014
@@ -138,7 +138,7 @@
LIST_ENTRY VacbListEntry;
LIST_ENTRY VacbLruListEntry;
/* Offset in the file which this view maps. */
- ULONG FileOffset;
+ LARGE_INTEGER FileOffset;
/* Mutex */
KMUTEX Mutex;
/* Number of references. */
@@ -187,7 +187,7 @@
CcRosGetVacb(
PROS_SHARED_CACHE_MAP SharedCacheMap,
ULONG FileOffset,
- PULONG BaseOffset,
+ PULONGLONG BaseOffset,
PVOID *BaseAddress,
PBOOLEAN UptoDate,
PROS_VACB *Vacb
@@ -305,9 +305,9 @@
FORCEINLINE
BOOLEAN
DoRangesIntersect(
- _In_ ULONG Offset1,
+ _In_ ULONGLONG Offset1,
_In_ ULONG Length1,
- _In_ ULONG Offset2,
+ _In_ ULONGLONG Offset2,
_In_ ULONG Length2)
{
if (Offset1 + Length1 <= Offset2)
@@ -320,9 +320,9 @@
FORCEINLINE
BOOLEAN
IsPointInRange(
- _In_ ULONG Offset1,
+ _In_ ULONGLONG Offset1,
_In_ ULONG Length1,
- _In_ ULONG Point)
+ _In_ ULONGLONG Point)
{
return DoRangesIntersect(Offset1, Length1, Point, 1);
}
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 11:51:46 2014
@@ -1066,7 +1066,7 @@
* Page - Variable that receives a page contains the read data.
*/
{
- ULONG BaseOffset;
+ ULONGLONG BaseOffset;
ULONGLONG FileOffset;
PVOID BaseAddress;
BOOLEAN UptoDate;