1 #ifndef __INCLUDE_INTERNAL_CC_H
2 #define __INCLUDE_INTERNAL_CC_H
3 /* $Id: cc.h,v 1.18 2003/06/27 21:28:30 hbirr Exp $ */
9 LIST_ENTRY BcbSegmentListHead
;
10 LIST_ENTRY BcbRemoveListEntry
;
11 BOOLEAN RemoveOnClose
;
13 PFILE_OBJECT FileObject
;
14 ULONG CacheSegmentSize
;
15 LARGE_INTEGER AllocationSize
;
16 LARGE_INTEGER FileSize
;
21 typedef struct _CACHE_SEGMENT
23 /* Base address of the region where the cache segment data is mapped. */
26 * Memory area representing the region where the cache segment data is
29 struct _MEMORY_AREA
* MemoryArea
;
30 /* Are the contents of the cache segment data valid. */
32 /* Are the contents of the cache segment data newer than those on disk. */
35 /* Entry in the list of segments for this BCB. */
36 LIST_ENTRY BcbSegmentListEntry
;
37 /* Entry in the list of segments which are dirty. */
38 LIST_ENTRY DirtySegmentListEntry
;
39 /* Entry in the list of segments. */
40 LIST_ENTRY CacheSegmentListEntry
;
41 LIST_ENTRY CacheSegmentLRUListEntry
;
42 /* Offset in the file which this cache segment maps. */
46 /* Number of references. */
48 /* Pointer to the BCB for the file which this cache segment maps data for. */
50 /* Pointer to the next cache segment in a chain. */
51 struct _CACHE_SEGMENT
* NextInChain
;
52 } CACHE_SEGMENT
, *PCACHE_SEGMENT
;
54 typedef struct _INTERNAL_BCB
57 PCACHE_SEGMENT CacheSegment
;
59 } INTERNAL_BCB
, *PINTERNAL_BCB
;
62 CcMdlReadCompleteDev (IN PMDL MdlChain
,
63 IN PDEVICE_OBJECT DeviceObject
);
66 CcRosGetCacheSegment(PBCB Bcb
,
71 PCACHE_SEGMENT
* CacheSeg
);
76 CcRosFreeCacheSegment(PBCB
, PCACHE_SEGMENT
);
79 ReadCacheSegment(PCACHE_SEGMENT CacheSeg
);
82 WriteCacheSegment(PCACHE_SEGMENT CacheSeg
);
87 CcRosUnmapCacheSegment(PBCB Bcb
, ULONG FileOffset
, BOOLEAN NowDirty
);
90 CcRosLookupCacheSegment(PBCB Bcb
, ULONG FileOffset
);
93 CcRosGetCacheSegmentChain(PBCB Bcb
,
96 PCACHE_SEGMENT
* CacheSeg
);
99 CcInitCacheZeroPage(VOID
);
102 CcRosMarkDirtyCacheSegment(PBCB Bcb
, ULONG FileOffset
);
105 CcRosFlushDirtyPages(ULONG Target
, PULONG Count
);
108 CcRosDereferenceCache(PFILE_OBJECT FileObject
);
111 CcRosReferenceCache(PFILE_OBJECT FileObject
);
114 CcRosSetRemoveOnClose(PSECTION_OBJECT_POINTERS SectionObjectPointer
);
117 CcRosReleaseCacheSegment (BCB
* Bcb
,
118 CACHE_SEGMENT
* CacheSeg
,
124 CcRosRequestCacheSegment (BCB
* Bcb
,
128 CACHE_SEGMENT
** CacheSeg
);
131 CcTryToInitializeFileCache(PFILE_OBJECT FileObject
);