1 #ifndef __INCLUDE_INTERNAL_CC_H
2 #define __INCLUDE_INTERNAL_CC_H
3 /* $Id: cc.h,v 1.14 2002/08/17 15:14:26 hbirr Exp $ */
8 LIST_ENTRY BcbSegmentListHead
;
9 PFILE_OBJECT FileObject
;
10 ULONG CacheSegmentSize
;
11 LARGE_INTEGER AllocationSize
;
12 LARGE_INTEGER FileSize
;
17 typedef struct _CACHE_SEGMENT
19 /* Base address of the region where the cache segment data is mapped. */
22 * Memory area representing the region where the cache segment data is
25 struct _MEMORY_AREA
* MemoryArea
;
26 /* Are the contents of the cache segment data valid. */
28 /* Are the contents of the cache segment data newer than those on disk. */
31 /* Entry in the list of segments for this BCB. */
32 LIST_ENTRY BcbSegmentListEntry
;
33 /* Entry in the list of segments which are dirty. */
34 LIST_ENTRY DirtySegmentListEntry
;
35 /* Entry in the list of segments. */
36 LIST_ENTRY CacheSegmentListEntry
;
37 LIST_ENTRY CacheSegmentLRUListEntry
;
38 /* Offset in the file which this cache segment maps. */
42 /* Number of references. */
44 /* Pointer to the BCB for the file which this cache segment maps data for. */
46 /* Pointer to the next cache segment in a chain. */
47 struct _CACHE_SEGMENT
* NextInChain
;
51 CcMdlReadCompleteDev (IN PMDL MdlChain
,
52 IN PDEVICE_OBJECT DeviceObject
);
54 CcRosGetCacheSegment(PBCB Bcb
,
59 PCACHE_SEGMENT
* CacheSeg
);
64 NTSTATUS STDCALL
CcRosFreeCacheSegment(PBCB
, PCACHE_SEGMENT
);
66 NTSTATUS
ReadCacheSegment(PCACHE_SEGMENT CacheSeg
);
68 NTSTATUS
WriteCacheSegment(PCACHE_SEGMENT CacheSeg
);
72 CcRosUnmapCacheSegment(PBCB Bcb
, ULONG FileOffset
, BOOLEAN NowDirty
);
74 CcRosSuggestFreeCacheSegment(PBCB Bcb
, ULONG FileOffset
, BOOLEAN NowDirty
);
76 CcRosGetCacheSegmentChain(PBCB Bcb
,
79 PCACHE_SEGMENT
* CacheSeg
);
80 VOID
CcInitCacheZeroPage(VOID
);
82 CcRosMarkDirtyCacheSegment(PBCB Bcb
, ULONG FileOffset
);
84 CcRosFlushDirtyPages(ULONG Target
, PULONG Count
);
86 VOID
CcRosDereferenceCache(PFILE_OBJECT FileObject
);
87 VOID
CcRosReferenceCache(PFILE_OBJECT FileObject
);