2002-10-01 Casper S. Hornstrup <chorns@users.sourceforge.net>
[reactos.git] / reactos / drivers / fs / minix / cache.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: services/fs/minix/cache.c
5 * PURPOSE: Minix FSD
6 * PROGRAMMER: David Welch (welch@mcmail.com)
7 * UPDATE HISTORY:
8 */
9
10 /* INCLUDES *****************************************************************/
11
12 #include <ddk/ntddk.h>
13 #include <ddk/ntifs.h>
14
15 //#define NDEBUG
16 #include <debug.h>
17
18 #include "minix.h"
19
20 /* FUNCTIONS ****************************************************************/
21
22 NTSTATUS MinixRequestCacheBlock(PDEVICE_OBJECT DeviceObject,
23 PBCB Bcb,
24 ULONG FileOffset,
25 PVOID* BaseAddress,
26 PCACHE_SEGMENT* CacheSeg)
27 {
28 BOOLEAN UptoDate;
29
30 CcRosRequestCacheSegment(Bcb,
31 FileOffset,
32 BaseAddress,
33 &UptoDate,
34 CacheSeg);
35 if (!UptoDate)
36 {
37 MinixReadPage(DeviceObject,
38 PAGE_ROUND_DOWN(FileOffset),
39 BaseAddress);
40 }
41 BaseAddress = BaseAddress + (FileOffset % PAGE_SIZE);
42
43 return(STATUS_SUCCESS);
44 }
45