mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTOSKRNL] Move data mapping implementation to an internel helper
This commit is contained in:
parent
df0137a169
commit
02da7b452c
1 changed files with 38 additions and 20 deletions
|
@ -31,12 +31,10 @@ ULONG CcPinReadNoWait = 0;
|
|||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
static
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
CcMapData (
|
||||
CcpMapData(
|
||||
IN PFILE_OBJECT FileObject,
|
||||
IN PLARGE_INTEGER FileOffset,
|
||||
IN ULONG Length,
|
||||
|
@ -53,19 +51,6 @@ CcMapData (
|
|||
LONGLONG ROffset;
|
||||
KIRQL OldIrql;
|
||||
|
||||
DPRINT("CcMapData(FileObject 0x%p, FileOffset %I64x, Length %lu, Flags 0x%lx,"
|
||||
" pBcb 0x%p, pBuffer 0x%p)\n", FileObject, FileOffset->QuadPart,
|
||||
Length, Flags, pBcb, pBuffer);
|
||||
|
||||
if (Flags & MAP_WAIT)
|
||||
{
|
||||
++CcMapDataWait;
|
||||
}
|
||||
else
|
||||
{
|
||||
++CcMapDataNoWait;
|
||||
}
|
||||
|
||||
ReadOffset = FileOffset->QuadPart;
|
||||
|
||||
ASSERT(FileObject);
|
||||
|
@ -160,11 +145,44 @@ CcMapData (
|
|||
InsertTailList(&SharedCacheMap->BcbList, &iBcb->BcbEntry);
|
||||
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
||||
|
||||
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx -> TRUE Bcb=%p\n",
|
||||
FileObject, FileOffset, Length, Flags, iBcb);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
CcMapData (
|
||||
IN PFILE_OBJECT FileObject,
|
||||
IN PLARGE_INTEGER FileOffset,
|
||||
IN ULONG Length,
|
||||
IN ULONG Flags,
|
||||
OUT PVOID *pBcb,
|
||||
OUT PVOID *pBuffer)
|
||||
{
|
||||
BOOLEAN Ret;
|
||||
|
||||
DPRINT("CcMapData(FileObject 0x%p, FileOffset %I64x, Length %lu, Flags 0x%lx,"
|
||||
" pBcb 0x%p, pBuffer 0x%p)\n", FileObject, FileOffset->QuadPart,
|
||||
Length, Flags, pBcb, pBuffer);
|
||||
|
||||
if (Flags & MAP_WAIT)
|
||||
{
|
||||
++CcMapDataWait;
|
||||
}
|
||||
else
|
||||
{
|
||||
++CcMapDataNoWait;
|
||||
}
|
||||
|
||||
Ret = CcpMapData(FileObject, FileOffset, Length, Flags, pBcb, pBuffer);
|
||||
|
||||
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx -> %d Bcb=%p\n",
|
||||
FileObject, FileOffset, Length, Flags, Ret, *pBcb);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
@ -246,7 +264,7 @@ CcPinRead (
|
|||
}
|
||||
|
||||
/* Map first */
|
||||
if (!CcMapData(FileObject, FileOffset, Length, Flags, Bcb, Buffer))
|
||||
if (!CcpMapData(FileObject, FileOffset, Length, Flags, Bcb, Buffer))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue