mirror of
https://github.com/reactos/reactos.git
synced 2024-10-31 03:48:17 +00:00
46 lines
1,004 B
C
46 lines
1,004 B
C
|
/*
|
||
|
* COPYRIGHT: See COPYING in the top level directory
|
||
|
* PROJECT: ReactOS kernel
|
||
|
* FILE: services/fs/minix/cache.c
|
||
|
* PURPOSE: Minix FSD
|
||
|
* PROGRAMMER: David Welch (welch@mcmail.com)
|
||
|
* UPDATE HISTORY:
|
||
|
*/
|
||
|
|
||
|
/* INCLUDES *****************************************************************/
|
||
|
|
||
|
#include <ntddk.h>
|
||
|
#include <ntifs.h>
|
||
|
|
||
|
//#define NDEBUG
|
||
|
#include <debug.h>
|
||
|
|
||
|
#include "minix.h"
|
||
|
|
||
|
/* FUNCTIONS ****************************************************************/
|
||
|
|
||
|
NTSTATUS MinixRequestCacheBlock(PDEVICE_OBJECT DeviceObject,
|
||
|
PBCB Bcb,
|
||
|
ULONG FileOffset,
|
||
|
PVOID* BaseAddress,
|
||
|
PCACHE_SEGMENT* CacheSeg)
|
||
|
{
|
||
|
BOOLEAN UptoDate;
|
||
|
|
||
|
CcRosRequestCacheSegment(Bcb,
|
||
|
FileOffset,
|
||
|
BaseAddress,
|
||
|
&UptoDate,
|
||
|
CacheSeg);
|
||
|
if (!UptoDate)
|
||
|
{
|
||
|
MinixReadPage(DeviceObject,
|
||
|
PAGE_ROUND_DOWN(FileOffset),
|
||
|
BaseAddress);
|
||
|
}
|
||
|
BaseAddress = BaseAddress + (FileOffset % PAGE_SIZE);
|
||
|
|
||
|
return(STATUS_SUCCESS);
|
||
|
}
|
||
|
|