[NTOSKRNL] Move data mapping implementation to an internel helper

This commit is contained in:
Pierre Schweitzer 2018-09-09 11:14:42 +02:00
parent df0137a169
commit 02da7b452c
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -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;
}