mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +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 *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
/*
|
static
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
CcMapData (
|
CcpMapData(
|
||||||
IN PFILE_OBJECT FileObject,
|
IN PFILE_OBJECT FileObject,
|
||||||
IN PLARGE_INTEGER FileOffset,
|
IN PLARGE_INTEGER FileOffset,
|
||||||
IN ULONG Length,
|
IN ULONG Length,
|
||||||
|
@ -53,19 +51,6 @@ CcMapData (
|
||||||
LONGLONG ROffset;
|
LONGLONG ROffset;
|
||||||
KIRQL OldIrql;
|
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;
|
ReadOffset = FileOffset->QuadPart;
|
||||||
|
|
||||||
ASSERT(FileObject);
|
ASSERT(FileObject);
|
||||||
|
@ -160,11 +145,44 @@ CcMapData (
|
||||||
InsertTailList(&SharedCacheMap->BcbList, &iBcb->BcbEntry);
|
InsertTailList(&SharedCacheMap->BcbList, &iBcb->BcbEntry);
|
||||||
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
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;
|
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
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
@ -246,7 +264,7 @@ CcPinRead (
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Map first */
|
/* Map first */
|
||||||
if (!CcMapData(FileObject, FileOffset, Length, Flags, Bcb, Buffer))
|
if (!CcpMapData(FileObject, FileOffset, Length, Flags, Bcb, Buffer))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue