ReactOS  0.4.15-dev-3326-ga91f5e8
cc.h File Reference

Go to the source code of this file.

Classes

struct  _PF_SCENARIO_ID
 
struct  _PF_LOG_ENTRY
 
struct  _PFSN_LOG_ENTRIES
 
struct  _PF_SECTION_INFO
 
struct  _PF_TRACE_HEADER
 
struct  _PFSN_TRACE_DUMP
 
struct  _PFSN_TRACE_HEADER
 
struct  _PFSN_PREFETCHER_GLOBALS
 
struct  _ROS_SHARED_CACHE_MAP
 
struct  _ROS_VACB
 
struct  _INTERNAL_BCB
 
struct  _LAZY_WRITER
 
struct  _WORK_QUEUE_ENTRY
 

Macros

#define _CC_DEBUG_   0x00
 
#define CC_API_DEBUG   0x01
 
#define CCTRACE(x, fmt, ...)   DPRINT(fmt, ##__VA_ARGS__)
 
#define READAHEAD_DISABLED   0x1
 
#define WRITEBEHIND_DISABLED   0x2
 
#define SHARED_CACHE_MAP_IN_CREATION   0x4
 
#define SHARED_CACHE_MAP_IN_LAZYWRITE   0x8
 
#define NODE_TYPE_DEFERRED_WRITE   0x02FC
 
#define NODE_TYPE_PRIVATE_MAP   0x02FE
 
#define NODE_TYPE_SHARED_MAP   0x02FF
 
#define CcBugCheck(A, B, C)   KeBugCheckEx(CACHE_MANAGER, BugCheckFileId | ((ULONG)(__LINE__)), A, B, C)
 
#define CcRosVacbIncRefCount(vacb)   InterlockedIncrement((PLONG)&(vacb)->ReferenceCount)
 
#define CcRosVacbGetRefCount(vacb)   InterlockedCompareExchange((PLONG)&(vacb)->ReferenceCount, 0, 0)
 

Typedefs

typedef struct _PF_SCENARIO_ID PF_SCENARIO_ID
 
typedef struct _PF_SCENARIO_IDPPF_SCENARIO_ID
 
typedef struct _PF_LOG_ENTRY PF_LOG_ENTRY
 
typedef struct _PF_LOG_ENTRYPPF_LOG_ENTRY
 
typedef struct _PFSN_LOG_ENTRIES PFSN_LOG_ENTRIES
 
typedef struct _PFSN_LOG_ENTRIESPPFSN_LOG_ENTRIES
 
typedef struct _PF_SECTION_INFO PF_SECTION_INFO
 
typedef struct _PF_SECTION_INFOPPF_SECTION_INFO
 
typedef struct _PF_TRACE_HEADER PF_TRACE_HEADER
 
typedef struct _PF_TRACE_HEADERPPF_TRACE_HEADER
 
typedef struct _PFSN_TRACE_DUMP PFSN_TRACE_DUMP
 
typedef struct _PFSN_TRACE_DUMPPPFSN_TRACE_DUMP
 
typedef struct _PFSN_TRACE_HEADER PFSN_TRACE_HEADER
 
typedef struct _PFSN_TRACE_HEADERPPFSN_TRACE_HEADER
 
typedef struct _PFSN_PREFETCHER_GLOBALS PFSN_PREFETCHER_GLOBALS
 
typedef struct _PFSN_PREFETCHER_GLOBALSPPFSN_PREFETCHER_GLOBALS
 
typedef struct _ROS_SHARED_CACHE_MAP ROS_SHARED_CACHE_MAP
 
typedef struct _ROS_SHARED_CACHE_MAPPROS_SHARED_CACHE_MAP
 
typedef struct _ROS_VACB ROS_VACB
 
typedef struct _ROS_VACBPROS_VACB
 
typedef struct _INTERNAL_BCB INTERNAL_BCB
 
typedef struct _INTERNAL_BCBPINTERNAL_BCB
 
typedef struct _LAZY_WRITER LAZY_WRITER
 
typedef struct _LAZY_WRITERPLAZY_WRITER
 
typedef struct _WORK_QUEUE_ENTRY WORK_QUEUE_ENTRY
 
typedef struct _WORK_QUEUE_ENTRYPWORK_QUEUE_ENTRY
 
typedef enum _WORK_QUEUE_FUNCTIONS WORK_QUEUE_FUNCTIONS
 
typedef enum _WORK_QUEUE_FUNCTIONSPWORK_QUEUE_FUNCTIONS
 

Enumerations

enum  _WORK_QUEUE_FUNCTIONS { ReadAhead = 1, WriteBehind = 2, LazyScan = 3, SetDone = 4 }
 

Functions

VOID NTAPI CcPfInitializePrefetcher (VOID)
 
VOID NTAPI CcMdlReadComplete2 (IN PFILE_OBJECT FileObject, IN PMDL MemoryDescriptorList)
 
VOID NTAPI CcMdlWriteComplete2 (IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain)
 
NTSTATUS CcRosFlushVacb (_In_ PROS_VACB Vacb, _Out_opt_ PIO_STATUS_BLOCK Iosb)
 
NTSTATUS CcRosGetVacb (PROS_SHARED_CACHE_MAP SharedCacheMap, LONGLONG FileOffset, PROS_VACB *Vacb)
 
BOOLEAN CcRosEnsureVacbResident (_In_ PROS_VACB Vacb, _In_ BOOLEAN Wait, _In_ BOOLEAN NoRead, _In_ ULONG Offset, _In_ ULONG Length)
 
VOID NTAPI CcInitView (VOID)
 
VOID NTAPI CcShutdownLazyWriter (VOID)
 
BOOLEAN CcInitializeCacheManager (VOID)
 
PROS_VACB CcRosLookupVacb (PROS_SHARED_CACHE_MAP SharedCacheMap, LONGLONG FileOffset)
 
VOID NTAPI CcInitCacheZeroPage (VOID)
 
VOID CcRosMarkDirtyVacb (PROS_VACB Vacb)
 
VOID CcRosUnmarkDirtyVacb (PROS_VACB Vacb, BOOLEAN LockViews)
 
NTSTATUS CcRosFlushDirtyPages (ULONG Target, PULONG Count, BOOLEAN Wait, BOOLEAN CalledFromLazy)
 
VOID CcRosDereferenceCache (PFILE_OBJECT FileObject)
 
VOID CcRosReferenceCache (PFILE_OBJECT FileObject)
 
NTSTATUS CcRosReleaseVacb (PROS_SHARED_CACHE_MAP SharedCacheMap, PROS_VACB Vacb, BOOLEAN Dirty, BOOLEAN Mapped)
 
NTSTATUS CcRosRequestVacb (PROS_SHARED_CACHE_MAP SharedCacheMap, LONGLONG FileOffset, PROS_VACB *Vacb)
 
NTSTATUS CcRosInitializeFileCache (PFILE_OBJECT FileObject, PCC_FILE_SIZES FileSizes, BOOLEAN PinAccess, PCACHE_MANAGER_CALLBACKS CallBacks, PVOID LazyWriterContext)
 
NTSTATUS CcRosReleaseFileCache (PFILE_OBJECT FileObject)
 
VOID NTAPI CcShutdownSystem (VOID)
 
VOID NTAPI CcWorkerThread (PVOID Parameter)
 
VOID NTAPI CcScanDpc (PKDPC Dpc, PVOID DeferredContext, PVOID SystemArgument1, PVOID SystemArgument2)
 
VOID CcScheduleLazyWriteScan (BOOLEAN NoDelay)
 
VOID CcPostDeferredWrites (VOID)
 
VOID CcPostWorkQueue (IN PWORK_QUEUE_ENTRY WorkItem, IN PLIST_ENTRY WorkQueue)
 
VOID CcPerformReadAhead (IN PFILE_OBJECT FileObject)
 
NTSTATUS CcRosInternalFreeVacb (IN PROS_VACB Vacb)
 
FORCEINLINE BOOLEAN DoRangesIntersect (_In_ LONGLONG Offset1, _In_ LONGLONG Length1, _In_ LONGLONG Offset2, _In_ LONGLONG Length2)
 
FORCEINLINE BOOLEAN IsPointInRange (_In_ LONGLONG Offset1, _In_ LONGLONG Length1, _In_ LONGLONG Point)
 
FORCEINLINE ULONG CcRosVacbDecRefCount (PROS_VACB vacb)
 

Variables

ULONG CcRosTraceLevel
 
LIST_ENTRY DirtyVacbListHead
 
ULONG CcDirtyPageThreshold
 
ULONG CcTotalDirtyPages
 
LIST_ENTRY CcDeferredWrites
 
KSPIN_LOCK CcDeferredWriteSpinLock
 
ULONG CcNumberWorkerThreads
 
LIST_ENTRY CcIdleWorkerThreadList
 
LIST_ENTRY CcExpressWorkQueue
 
LIST_ENTRY CcRegularWorkQueue
 
LIST_ENTRY CcPostTickWorkQueue
 
NPAGED_LOOKASIDE_LIST CcTwilightLookasideList
 
LARGE_INTEGER CcIdleDelay
 
ULONG CcLazyWritePages
 
ULONG CcLazyWriteIos
 
ULONG CcMapDataWait
 
ULONG CcMapDataNoWait
 
ULONG CcPinReadWait
 
ULONG CcPinReadNoWait
 
ULONG CcPinMappedDataCount
 
ULONG CcDataPages
 
ULONG CcDataFlushes
 
LAZY_WRITER LazyWriter
 

Macro Definition Documentation

◆ _CC_DEBUG_

#define _CC_DEBUG_   0x00

Definition at line 6 of file cc.h.

◆ CC_API_DEBUG

#define CC_API_DEBUG   0x01

Definition at line 11 of file cc.h.

◆ CcBugCheck

#define CcBugCheck (   A,
  B,
  C 
)    KeBugCheckEx(CACHE_MANAGER, BugCheckFileId | ((ULONG)(__LINE__)), A, B, C)

Definition at line 469 of file cc.h.

◆ CcRosVacbGetRefCount

#define CcRosVacbGetRefCount (   vacb)    InterlockedCompareExchange((PLONG)&(vacb)->ReferenceCount, 0, 0)

Definition at line 510 of file cc.h.

◆ CcRosVacbIncRefCount

#define CcRosVacbIncRefCount (   vacb)    InterlockedIncrement((PLONG)&(vacb)->ReferenceCount)

Definition at line 495 of file cc.h.

◆ CCTRACE

#define CCTRACE (   x,
  fmt,
  ... 
)    DPRINT(fmt, ##__VA_ARGS__)

Definition at line 36 of file cc.h.

◆ NODE_TYPE_DEFERRED_WRITE

#define NODE_TYPE_DEFERRED_WRITE   0x02FC

Definition at line 286 of file cc.h.

◆ NODE_TYPE_PRIVATE_MAP

#define NODE_TYPE_PRIVATE_MAP   0x02FE

Definition at line 287 of file cc.h.

◆ NODE_TYPE_SHARED_MAP

#define NODE_TYPE_SHARED_MAP   0x02FF

Definition at line 288 of file cc.h.

◆ READAHEAD_DISABLED

#define READAHEAD_DISABLED   0x1

Definition at line 201 of file cc.h.

◆ SHARED_CACHE_MAP_IN_CREATION

#define SHARED_CACHE_MAP_IN_CREATION   0x4

Definition at line 203 of file cc.h.

◆ SHARED_CACHE_MAP_IN_LAZYWRITE

#define SHARED_CACHE_MAP_IN_LAZYWRITE   0x8

Definition at line 204 of file cc.h.

◆ WRITEBEHIND_DISABLED

#define WRITEBEHIND_DISABLED   0x2

Definition at line 202 of file cc.h.

Typedef Documentation

◆ INTERNAL_BCB

◆ LAZY_WRITER

◆ PF_LOG_ENTRY

◆ PF_SCENARIO_ID

◆ PF_SECTION_INFO

◆ PF_TRACE_HEADER

◆ PFSN_LOG_ENTRIES

◆ PFSN_PREFETCHER_GLOBALS

◆ PFSN_TRACE_DUMP

◆ PFSN_TRACE_HEADER

◆ PINTERNAL_BCB

◆ PLAZY_WRITER

◆ PPF_LOG_ENTRY

◆ PPF_SCENARIO_ID

◆ PPF_SECTION_INFO

◆ PPF_TRACE_HEADER

◆ PPFSN_LOG_ENTRIES

◆ PPFSN_PREFETCHER_GLOBALS

◆ PPFSN_TRACE_DUMP

◆ PPFSN_TRACE_HEADER

◆ PROS_SHARED_CACHE_MAP

◆ PROS_VACB

◆ PWORK_QUEUE_ENTRY

◆ PWORK_QUEUE_FUNCTIONS

◆ ROS_SHARED_CACHE_MAP

◆ ROS_VACB

◆ WORK_QUEUE_ENTRY

◆ WORK_QUEUE_FUNCTIONS

Enumeration Type Documentation

◆ _WORK_QUEUE_FUNCTIONS

Enumerator
ReadAhead 
WriteBehind 
LazyScan 
SetDone 

Definition at line 276 of file cc.h.

277 {
278  ReadAhead = 1,
279  WriteBehind = 2,
280  LazyScan = 3,
281  SetDone = 4,
Definition: cc.h:280
Definition: cc.h:281
Definition: cc.h:278
enum _WORK_QUEUE_FUNCTIONS WORK_QUEUE_FUNCTIONS
enum _WORK_QUEUE_FUNCTIONS * PWORK_QUEUE_FUNCTIONS

Function Documentation

◆ CcInitCacheZeroPage()

VOID NTAPI CcInitCacheZeroPage ( VOID  )

Definition at line 56 of file copy.c.

58 {
60 
62  //MI_SET_PROCESS2(PsGetCurrentProcess()->ImageFileName);
64  if (!NT_SUCCESS(Status))
65  {
66  DbgPrint("Can't allocate CcZeroPage.\n");
67  KeBugCheck(CACHE_MANAGER);
68  }
70 }
#define DbgPrint
Definition: hal.h:12
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN MyWait, PPFN_NUMBER AllocatedPage)
Definition: balance.c:280
#define MC_SYSTEM
Definition: mm.h:104
VOID NTAPI MiZeroPhysicalPage(IN PFN_NUMBER PageFrameIndex)
Definition: pfnlist.c:122
DECLSPEC_NORETURN VOID NTAPI KeBugCheck(ULONG BugCheckCode)
Definition: bug.c:1427
#define MI_SET_USAGE(x)
Definition: mm.h:306
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static PFN_NUMBER CcZeroPage
Definition: copy.c:19

◆ CcInitializeCacheManager()

BOOLEAN CcInitializeCacheManager ( VOID  )

Definition at line 83 of file fssup.c.

84 {
85  int i;
86 
87  DPRINT("Initialize\n");
88  for (i = 0; i < CACHE_NUM_SECTIONS; i++)
89  {
90  KeInitializeEvent(&CcCacheSections[i].ExclusiveWait,
92  FALSE);
93 
94  InitializeListHead(&CcCacheSections[i].ThisFileList);
95  }
96 
98 
102 
105  DPRINT1("Cache has %d entries\n", CcCacheBitmap->SizeOfBitMap);
107 
108  return TRUE;
109 }
KEVENT CcpLazyWriteEvent
Definition: lazyrite.c:18
PULONG Buffer
Definition: typedefs.h:91
FAST_MUTEX CcMutex
Definition: pinsup.c:101
#define ROUND_UP(n, align)
Definition: eventvwr.h:31
#define TRUE
Definition: types.h:120
#define CACHE_NUM_SECTIONS
Definition: newcc.h:125
NOCC_BCB CcCacheSections[CACHE_NUM_SECTIONS]
Definition: pinsup.c:98
#define FALSE
Definition: types.h:117
KEVENT CcDeleteEvent
Definition: pinsup.c:102
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
KEVENT CcFinalizeEvent
Definition: pinsup.c:103
PRTL_BITMAP CcCacheBitmap
Definition: pinsup.c:100
ULONG SizeOfBitMap
Definition: typedefs.h:90
LIST_ENTRY CcpAllSharedCacheMaps
Definition: fssup.c:76
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
unsigned int * PULONG
Definition: retypes.h:1
#define DPRINT1
Definition: precomp.h:8
#define DPRINT
Definition: sndvol32.h:71

Referenced by Phase1InitializationDiscard().

◆ CcInitView()

VOID NTAPI CcInitView ( VOID  )

Definition at line 1355 of file view.c.

1357 {
1358  DPRINT("CcInitView()\n");
1359 
1366  NULL,
1367  NULL,
1368  0,
1369  sizeof(INTERNAL_BCB),
1370  TAG_BCB,
1371  20);
1373  NULL,
1374  NULL,
1375  0,
1376  sizeof(ROS_SHARED_CACHE_MAP),
1378  20);
1380  NULL,
1381  NULL,
1382  0,
1383  sizeof(ROS_VACB),
1384  TAG_VACB,
1385  20);
1386 
1388 }
Definition: cc.h:206
#define TAG_VACB
Definition: tag.h:5
static NPAGED_LOOKASIDE_LIST VacbLookasideList
Definition: view.c:46
#define TAG_BCB
Definition: nodetype.h:157
static LIST_ENTRY VacbLruListHead
Definition: view.c:42
#define TAG_SHARED_CACHE_MAP
Definition: tag.h:6
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
LIST_ENTRY CcCleanSharedCacheMapList
Definition: view.c:59
VOID NTAPI CcInitCacheZeroPage(VOID)
Definition: copy.c:56
VOID NTAPI ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
Definition: lookas.c:218
static NPAGED_LOOKASIDE_LIST SharedCacheMapLookasideList
Definition: view.c:45
LIST_ENTRY CcDeferredWrites
Definition: view.c:57
KSPIN_LOCK CcDeferredWriteSpinLock
Definition: view.c:58
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
NPAGED_LOOKASIDE_LIST iBcbLookasideList
Definition: view.c:44
#define NULL
Definition: types.h:112
#define DPRINT
Definition: sndvol32.h:71
LIST_ENTRY DirtyVacbListHead
Definition: view.c:41

◆ CcMdlReadComplete2()

VOID NTAPI CcMdlReadComplete2 ( IN PFILE_OBJECT  FileObject,
IN PMDL  MemoryDescriptorList 
)

Definition at line 83 of file mdlsup.c.

85 {
87 }
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by CcMdlReadComplete(), and FsRtlMdlReadCompleteDev().

◆ CcMdlWriteComplete2()

VOID NTAPI CcMdlWriteComplete2 ( IN PFILE_OBJECT  FileObject,
IN PLARGE_INTEGER  FileOffset,
IN PMDL  MdlChain 
)

Definition at line 111 of file mdlsup.c.

114 {
116 }
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by CcMdlWriteComplete(), and FsRtlMdlWriteCompleteDev().

◆ CcPerformReadAhead()

VOID CcPerformReadAhead ( IN PFILE_OBJECT  FileObject)

Definition at line 130 of file copy.c.

132 {
134  LONGLONG CurrentOffset;
135  KIRQL OldIrql;
136  PROS_SHARED_CACHE_MAP SharedCacheMap;
137  PROS_VACB Vacb;
138  ULONG PartialLength;
139  ULONG Length;
140  PPRIVATE_CACHE_MAP PrivateCacheMap;
141  BOOLEAN Locked;
142 
143  SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
144 
145  /* Critical:
146  * PrivateCacheMap might disappear in-between if the handle
147  * to the file is closed (private is attached to the handle not to
148  * the file), so we need to lock the master lock while we deal with
149  * it. It won't disappear without attempting to lock such lock.
150  */
152  PrivateCacheMap = FileObject->PrivateCacheMap;
153  /* If the handle was closed since the read ahead was scheduled, just quit */
154  if (PrivateCacheMap == NULL)
155  {
158  return;
159  }
160  /* Otherwise, extract read offset and length and release private map */
161  else
162  {
164  CurrentOffset = PrivateCacheMap->ReadAheadOffset[1].QuadPart;
165  Length = PrivateCacheMap->ReadAheadLength[1];
167  }
169 
170  /* Time to go! */
171  DPRINT("Doing ReadAhead for %p\n", FileObject);
172  /* Lock the file, first */
173  if (!SharedCacheMap->Callbacks->AcquireForReadAhead(SharedCacheMap->LazyWriteContext, FALSE))
174  {
175  Locked = FALSE;
176  goto Clear;
177  }
178 
179  /* Remember it's locked */
180  Locked = TRUE;
181 
182  /* Don't read past the end of the file */
183  if (CurrentOffset >= SharedCacheMap->FileSize.QuadPart)
184  {
185  goto Clear;
186  }
187  if (CurrentOffset + Length > SharedCacheMap->FileSize.QuadPart)
188  {
189  Length = SharedCacheMap->FileSize.QuadPart - CurrentOffset;
190  }
191 
192  /* Next of the algorithm will lock like CcCopyData with the slight
193  * difference that we don't copy data back to an user-backed buffer
194  * We just bring data into Cc
195  */
196  PartialLength = CurrentOffset % VACB_MAPPING_GRANULARITY;
197  if (PartialLength != 0)
198  {
199  PartialLength = min(Length, VACB_MAPPING_GRANULARITY - PartialLength);
200  Status = CcRosRequestVacb(SharedCacheMap,
201  ROUND_DOWN(CurrentOffset, VACB_MAPPING_GRANULARITY),
202  &Vacb);
203  if (!NT_SUCCESS(Status))
204  {
205  DPRINT1("Failed to request VACB: %lx!\n", Status);
206  goto Clear;
207  }
208 
210  CurrentOffset % VACB_MAPPING_GRANULARITY, PartialLength);
211  if (!NT_SUCCESS(Status))
212  {
213  CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE);
214  DPRINT1("Failed to read data: %lx!\n", Status);
215  goto Clear;
216  }
217 
218  CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE);
219 
220  Length -= PartialLength;
221  CurrentOffset += PartialLength;
222  }
223 
224  while (Length > 0)
225  {
226  ASSERT(CurrentOffset % VACB_MAPPING_GRANULARITY == 0);
227  PartialLength = min(VACB_MAPPING_GRANULARITY, Length);
228  Status = CcRosRequestVacb(SharedCacheMap,
229  CurrentOffset,
230  &Vacb);
231  if (!NT_SUCCESS(Status))
232  {
233  DPRINT1("Failed to request VACB: %lx!\n", Status);
234  goto Clear;
235  }
236 
237  Status = CcRosEnsureVacbResident(Vacb, TRUE, FALSE, 0, PartialLength);
238  if (!NT_SUCCESS(Status))
239  {
240  CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE);
241  DPRINT1("Failed to read data: %lx!\n", Status);
242  goto Clear;
243  }
244 
245  CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE);
246 
247  Length -= PartialLength;
248  CurrentOffset += PartialLength;
249  }
250 
251 Clear:
252  /* See previous comment about private cache map */
254  PrivateCacheMap = FileObject->PrivateCacheMap;
255  if (PrivateCacheMap != NULL)
256  {
257  /* Mark read ahead as unactive */
259  InterlockedAnd((volatile long *)&PrivateCacheMap->UlongFlags, ~PRIVATE_CACHE_MAP_READ_AHEAD_ACTIVE);
261  }
263 
264  /* If file was locked, release it */
265  if (Locked)
266  {
267  SharedCacheMap->Callbacks->ReleaseFromReadAhead(SharedCacheMap->LazyWriteContext);
268  }
269 
270  /* And drop our extra reference (See: CcScheduleReadAhead) */
272 
273  return;
274 }
#define InterlockedAnd
Definition: interlocked.h:62
Definition: cc.h:206
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define TRUE
Definition: types.h:120
VOID NTAPI KeAcquireSpinLockAtDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:198
LONG NTSTATUS
Definition: precomp.h:26
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define FALSE
Definition: types.h:117
_In_ PMEMORY_AREA _In_ PVOID _In_ BOOLEAN Locked
Definition: newmm.h:207
NTSTATUS CcRosRequestVacb(PROS_SHARED_CACHE_MAP SharedCacheMap, LONGLONG FileOffset, PROS_VACB *Vacb)
Definition: view.c:914
unsigned char BOOLEAN
PCACHE_MANAGER_CALLBACKS Callbacks
Definition: cc.h:185
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
KIRQL OldIrql
Definition: mm.h:1502
KSPIN_LOCK ReadAheadSpinLock
Definition: cctypes.h:83
Status
Definition: gdiplustypes.h:24
int64_t LONGLONG
Definition: typedefs.h:68
#define ASSERT(a)
Definition: mode.c:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID NTAPI KeReleaseSpinLockFromDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:221
#define ObDereferenceObject
Definition: obfuncs.h:203
VOID FASTCALL KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql)
Definition: spinlock.c:154
PACQUIRE_FOR_READ_AHEAD AcquireForReadAhead
Definition: cctypes.h:41
PRELEASE_FROM_READ_AHEAD ReleaseFromReadAhead
Definition: cctypes.h:42
KIRQL FASTCALL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
Definition: spinlock.c:108
#define ROUND_DOWN(n, align)
Definition: eventvwr.h:30
BOOLEAN CcRosEnsureVacbResident(_In_ PROS_VACB Vacb, _In_ BOOLEAN Wait, _In_ BOOLEAN NoRead, _In_ ULONG Offset, _In_ ULONG Length)
Definition: view.c:816
LARGE_INTEGER ReadAheadOffset[2]
Definition: cctypes.h:81
#define min(a, b)
Definition: monoChain.cc:55
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
#define VACB_MAPPING_GRANULARITY
PVOID LazyWriteContext
Definition: cc.h:186
LARGE_INTEGER FileSize
Definition: cc.h:175
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS CcRosReleaseVacb(PROS_SHARED_CACHE_MAP SharedCacheMap, PROS_VACB Vacb, BOOLEAN Dirty, BOOLEAN Mapped)
Definition: view.c:453
void Clear(USHORT Window)
Definition: hardware.c:684
#define DPRINT
Definition: sndvol32.h:71
ULONG UlongFlags
Definition: cctypes.h:73
#define PRIVATE_CACHE_MAP_READ_AHEAD_ACTIVE
Definition: cctypes.h:64
ULONG ReadAheadLength[2]
Definition: cctypes.h:82
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by CcWorkerThread().

◆ CcPfInitializePrefetcher()

VOID NTAPI CcPfInitializePrefetcher ( VOID  )

Definition at line 114 of file fssup.c.

115 {
116  /* Notify debugger */
119  "CCPF: InitializePrefetecher()\n");
120 
121  /* Setup the Prefetcher Data */
125 
126  /* FIXME: Setup the rest of the prefetecher */
127 }
FAST_MUTEX CompletedTracesLock
Definition: cc.h:164
NTSYSAPI ULONG __cdecl DbgPrintEx(_In_ ULONG ComponentId, _In_ ULONG Level, _In_z_ _Printf_format_string_ PCSTR Format,...)
LIST_ENTRY CompletedTraces
Definition: cc.h:163
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
PFSN_PREFETCHER_GLOBALS CcPfGlobals
Definition: fssup.c:20
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
LIST_ENTRY ActiveTraces
Definition: cc.h:160
#define DPFLTR_TRACE_LEVEL
Definition: kdtypes.h:32

Referenced by Phase1InitializationDiscard().

◆ CcPostDeferredWrites()

VOID CcPostDeferredWrites ( VOID  )

Definition at line 73 of file copy.c.

74 {
75  LIST_ENTRY ToInsertBack;
76 
77  InitializeListHead(&ToInsertBack);
78 
79  /* We'll try to write as much as we can */
80  while (TRUE)
81  {
82  PDEFERRED_WRITE DeferredWrite;
83  PLIST_ENTRY ListEntry;
84 
85  DeferredWrite = NULL;
86 
88 
89  if (!ListEntry)
90  break;
91 
92  DeferredWrite = CONTAINING_RECORD(ListEntry, DEFERRED_WRITE, DeferredWriteLinks);
93 
94  /* Check if we can write */
95  if (CcCanIWrite(DeferredWrite->FileObject, DeferredWrite->BytesToWrite, FALSE, RetryForceCheckPerFile))
96  {
97  /* If we have an event, set it and go along */
98  if (DeferredWrite->Event)
99  {
100  KeSetEvent(DeferredWrite->Event, IO_NO_INCREMENT, FALSE);
101  }
102  /* Otherwise, call the write routine and free the context */
103  else
104  {
105  DeferredWrite->PostRoutine(DeferredWrite->Context1, DeferredWrite->Context2);
106  ExFreePoolWithTag(DeferredWrite, 'CcDw');
107  }
108  continue;
109  }
110 
111  /* Keep it for later */
112  InsertHeadList(&ToInsertBack, &DeferredWrite->DeferredWriteLinks);
113 
114  /* If we don't accept modified pages, stop here */
115  if (!DeferredWrite->LimitModifiedPages)
116  {
117  break;
118  }
119  }
120 
121  /* Insert what we couldn't write back in the list */
122  while (!IsListEmpty(&ToInsertBack))
123  {
124  PLIST_ENTRY ListEntry = RemoveTailList(&ToInsertBack);
126  }
127 }
BOOLEAN LimitModifiedPages
Definition: cctypes.h:178
#define TRUE
Definition: types.h:120
FORCEINLINE VOID InsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
Definition: rtlfuncs.h:201
BOOLEAN NTAPI CcCanIWrite(IN PFILE_OBJECT FileObject, IN ULONG BytesToWrite, IN BOOLEAN Wait, IN BOOLEAN Retrying)
Definition: copy.c:281
FORCEINLINE PLIST_ENTRY RemoveTailList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:154
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
PLIST_ENTRY NTAPI ExInterlockedRemoveHeadList(IN OUT PLIST_ENTRY ListHead, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:166
#define FALSE
Definition: types.h:117
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
LIST_ENTRY DeferredWriteLinks
Definition: cctypes.h:173
LIST_ENTRY CcDeferredWrites
Definition: view.c:57
KSPIN_LOCK CcDeferredWriteSpinLock
Definition: view.c:58
Definition: typedefs.h:119
PFILE_OBJECT FileObject
Definition: cctypes.h:171
PVOID Context1
Definition: cctypes.h:176
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define NULL
Definition: types.h:112
PCC_POST_DEFERRED_WRITE PostRoutine
Definition: cctypes.h:175
#define IO_NO_INCREMENT
Definition: iotypes.h:598
ULONG BytesToWrite
Definition: cctypes.h:172
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
PKEVENT Event
Definition: cctypes.h:174
PVOID Context2
Definition: cctypes.h:177
PLIST_ENTRY NTAPI ExInterlockedInsertHeadList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:114

Referenced by CcCanIWrite(), CcDeferWrite(), and CcLazyWriteScan().

◆ CcPostWorkQueue()

VOID CcPostWorkQueue ( IN PWORK_QUEUE_ENTRY  WorkItem,
IN PLIST_ENTRY  WorkQueue 
)

Definition at line 53 of file lazywrite.c.

56 {
57  KIRQL OldIrql;
58  PWORK_QUEUE_ITEM ThreadToSpawn;
59 
60  /* First of all, insert the item in the queue */
62  InsertTailList(WorkQueue, &WorkItem->WorkQueueLinks);
63 
64  /* Now, define whether we have to spawn a new work thread
65  * We will spawn a new one if:
66  * - There's no throttle in action
67  * - There's still at least one idle thread
68  */
69  ThreadToSpawn = NULL;
71  {
72  PLIST_ENTRY ListEntry;
73 
74  /* Get the idle thread */
76  ThreadToSpawn = CONTAINING_RECORD(ListEntry, WORK_QUEUE_ITEM, List);
77 
78  /* We're going to have one more! */
80  }
81 
83 
84  /* If we have a thread to spawn, do it! */
85  if (ThreadToSpawn != NULL)
86  {
87  /* We NULLify it to be consistent with initialization */
88  ThreadToSpawn->List.Flink = NULL;
89  ExQueueWorkItem(ThreadToSpawn, CriticalWorkQueue);
90  }
91 }
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:723
LIST_ENTRY List
Definition: extypes.h:203
#define InsertTailList(ListHead, Entry)
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
UCHAR KIRQL
Definition: env_spec_w32.h:591
LIST_ENTRY CcIdleWorkerThreadList
Definition: lazywrite.c:41
LIST_ENTRY WorkQueue
Definition: workqueue.c:20
ULONG CcNumberActiveWorkerThreads
Definition: lazywrite.c:44
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
KIRQL OldIrql
Definition: mm.h:1502
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
VOID FASTCALL KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql)
Definition: spinlock.c:154
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
Definition: typedefs.h:119
KIRQL FASTCALL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
Definition: spinlock.c:108
#define NULL
Definition: types.h:112
BOOLEAN CcQueueThrottle
Definition: lazywrite.c:43
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
Definition: wdfworkitem.h:110

Referenced by CcLazyWriteScan(), CcScanDpc(), and CcScheduleReadAhead().

◆ CcRosDereferenceCache()

VOID CcRosDereferenceCache ( PFILE_OBJECT  FileObject)

◆ CcRosEnsureVacbResident()

BOOLEAN CcRosEnsureVacbResident ( _In_ PROS_VACB  Vacb,
_In_ BOOLEAN  Wait,
_In_ BOOLEAN  NoRead,
_In_ ULONG  Offset,
_In_ ULONG  Length 
)

Definition at line 816 of file view.c.

823 {
825 
827 
828 #if 0
829  if ((Vacb->FileOffset.QuadPart + Offset) > Vacb->SharedCacheMap->SectionSize.QuadPart)
830  {
831  DPRINT1("Vacb read beyond the file size!\n");
832  return FALSE;
833  }
834 #endif
835 
836  BaseAddress = (PVOID)((ULONG_PTR)Vacb->BaseAddress + Offset);
837 
838  /* Check if the pages are resident */
840  {
841  if (!Wait)
842  {
843  return FALSE;
844  }
845 
846  if (!NoRead)
847  {
848  PROS_SHARED_CACHE_MAP SharedCacheMap = Vacb->SharedCacheMap;
849  NTSTATUS Status = MmMakeDataSectionResident(SharedCacheMap->FileObject->SectionObjectPointer,
850  Vacb->FileOffset.QuadPart + Offset,
851  Length,
852  &SharedCacheMap->ValidDataLength);
853  if (!NT_SUCCESS(Status))
855  }
856  }
857 
858  return TRUE;
859 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define TRUE
Definition: types.h:120
NTSTATUS NTAPI MmMakeDataSectionResident(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_ LONGLONG Offset, _In_ ULONG Length, _In_ PLARGE_INTEGER ValidDataLength)
Definition: section.c:4809
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:167
BOOLEAN NTAPI MmArePagesResident(_In_ PEPROCESS Process, _In_ PVOID BaseAddress, _In_ ULONG Length)
Definition: section.c:4664
LONG NTSTATUS
Definition: precomp.h:26
#define ExRaiseStatus
Definition: ntoskrnl.h:104
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define FALSE
Definition: types.h:117
void * PVOID
Definition: retypes.h:9
Status
Definition: gdiplustypes.h:24
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
#define ASSERT(a)
Definition: mode.c:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
#define VACB_MAPPING_GRANULARITY
LARGE_INTEGER ValidDataLength
Definition: cc.h:178
PFILE_OBJECT FileObject
Definition: cc.h:179

Referenced by CcCopyRead(), CcCopyWrite(), CcMapData(), CcPerformReadAhead(), CcpPinData(), and CcZeroData().

◆ CcRosFlushDirtyPages()

NTSTATUS CcRosFlushDirtyPages ( ULONG  Target,
PULONG  Count,
BOOLEAN  Wait,
BOOLEAN  CalledFromLazy 
)

Definition at line 305 of file view.c.

310 {
311  PLIST_ENTRY current_entry;
313  KIRQL OldIrql;
314  BOOLEAN FlushAll = (Target == MAXULONG);
315 
316  DPRINT("CcRosFlushDirtyPages(Target %lu)\n", Target);
317 
318  (*Count) = 0;
319 
322 
323  current_entry = DirtyVacbListHead.Flink;
324  if (current_entry == &DirtyVacbListHead)
325  {
326  DPRINT("No Dirty pages\n");
327  }
328 
329  while (((current_entry != &DirtyVacbListHead) && (Target > 0)) || FlushAll)
330  {
331  PROS_SHARED_CACHE_MAP SharedCacheMap;
333  BOOLEAN Locked;
334 
335  if (current_entry == &DirtyVacbListHead)
336  {
337  ASSERT(FlushAll);
339  break;
340  current_entry = DirtyVacbListHead.Flink;
341  }
342 
343  current = CONTAINING_RECORD(current_entry,
344  ROS_VACB,
345  DirtyVacbListEntry);
346  current_entry = current_entry->Flink;
347 
349 
350  SharedCacheMap = current->SharedCacheMap;
351 
352  /* When performing lazy write, don't handle temporary files */
353  if (CalledFromLazy && BooleanFlagOn(SharedCacheMap->FileObject->Flags, FO_TEMPORARY_FILE))
354  {
356  continue;
357  }
358 
359  /* Don't attempt to lazy write the files that asked not to */
360  if (CalledFromLazy && BooleanFlagOn(SharedCacheMap->Flags, WRITEBEHIND_DISABLED))
361  {
363  continue;
364  }
365 
366  ASSERT(current->Dirty);
367 
368  /* Do not lazy-write the same file concurrently. Fastfat ASSERTS on that */
369  if (SharedCacheMap->Flags & SHARED_CACHE_MAP_IN_LAZYWRITE)
370  {
372  continue;
373  }
374 
375  SharedCacheMap->Flags |= SHARED_CACHE_MAP_IN_LAZYWRITE;
376 
377  /* Keep a ref on the shared cache map */
378  SharedCacheMap->OpenCount++;
379 
381 
382  Locked = SharedCacheMap->Callbacks->AcquireForLazyWrite(SharedCacheMap->LazyWriteContext, Wait);
383  if (!Locked)
384  {
385  DPRINT("Not locked!");
386  ASSERT(!Wait);
389  SharedCacheMap->Flags &= ~SHARED_CACHE_MAP_IN_LAZYWRITE;
390 
391  if (--SharedCacheMap->OpenCount == 0)
392  CcRosDeleteFileCache(SharedCacheMap->FileObject, SharedCacheMap, &OldIrql);
393 
394  continue;
395  }
396 
399 
400  SharedCacheMap->Callbacks->ReleaseFromLazyWrite(SharedCacheMap->LazyWriteContext);
401 
402  /* We release the VACB before acquiring the lock again, because
403  * CcRosVacbDecRefCount might free the VACB, as CcRosFlushVacb dropped a
404  * Refcount. Freeing must be done outside of the lock.
405  * The refcount is decremented atomically. So this is OK. */
408 
409  SharedCacheMap->Flags &= ~SHARED_CACHE_MAP_IN_LAZYWRITE;
410 
411  if (--SharedCacheMap->OpenCount == 0)
412  CcRosDeleteFileCache(SharedCacheMap->FileObject, SharedCacheMap, &OldIrql);
413 
414  if (!NT_SUCCESS(Status) && (Status != STATUS_END_OF_FILE) &&
416  {
417  DPRINT1("CC: Failed to flush VACB.\n");
418  }
419  else
420  {
421  ULONG PagesFreed;
422 
423  /* How many pages did we free? */
424  PagesFreed = Iosb.Information / PAGE_SIZE;
425  (*Count) += PagesFreed;
426 
427  if (!Wait)
428  {
429  /* Make sure we don't overflow target! */
430  if (Target < PagesFreed)
431  {
432  /* If we would have, jump to zero directly */
433  Target = 0;
434  }
435  else
436  {
437  Target -= PagesFreed;
438  }
439  }
440  }
441 
442  current_entry = DirtyVacbListHead.Flink;
443  }
444 
447 
448  DPRINT("CcRosFlushDirtyPages() finished\n");
449  return STATUS_SUCCESS;
450 }
Definition: cc.h:206
ULONG OpenCount
Definition: cc.h:174
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:167
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
#define SHARED_CACHE_MAP_IN_LAZYWRITE
Definition: cc.h:204
#define STATUS_END_OF_FILE
Definition: shellext.h:67
UCHAR KIRQL
Definition: env_spec_w32.h:591
_In_ PMEMORY_AREA _In_ PVOID _In_ BOOLEAN Locked
Definition: newmm.h:207
unsigned char BOOLEAN
#define STATUS_MEDIA_WRITE_PROTECTED
Definition: udferr_usr.h:161
PCACHE_MANAGER_CALLBACKS Callbacks
Definition: cc.h:185
#define WRITEBEHIND_DISABLED
Definition: cc.h:202
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
KIRQL OldIrql
Definition: mm.h:1502
Status
Definition: gdiplustypes.h:24
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define ASSERT(a)
Definition: mode.c:44
return Iosb
Definition: create.c:4402
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PACQUIRE_FOR_LAZY_WRITE AcquireForLazyWrite
Definition: cctypes.h:39
VOID FASTCALL KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql)
Definition: spinlock.c:154
struct task_struct * current
Definition: linux.c:32
FORCEINLINE ULONG CcRosVacbDecRefCount(PROS_VACB vacb)
Definition: cc.h:498
#define CcRosVacbIncRefCount(vacb)
Definition: cc.h:495
#define KeEnterCriticalRegion()
Definition: ke_x.h:88
#define PAGE_SIZE
Definition: env_spec_w32.h:49
Definition: typedefs.h:119
KIRQL FASTCALL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
Definition: spinlock.c:108
#define MAXULONG
Definition: typedefs.h:251
NTSTATUS CcRosFlushVacb(_In_ PROS_VACB Vacb, _Out_opt_ PIO_STATUS_BLOCK Iosb)
Definition: view.c:159
#define KeLeaveCriticalRegion()
Definition: ke_x.h:119
static NTSTATUS CcRosDeleteFileCache(PFILE_OBJECT FileObject, PROS_SHARED_CACHE_MAP SharedCacheMap, PKIRQL OldIrql)
Definition: view.c:205
#define FO_TEMPORARY_FILE
Definition: iotypes.h:1791
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
#define DPRINT1
Definition: precomp.h:8
PVOID LazyWriteContext
Definition: cc.h:186
PRELEASE_FROM_LAZY_WRITE ReleaseFromLazyWrite
Definition: cctypes.h:40
unsigned int ULONG
Definition: retypes.h:1
#define STATUS_SUCCESS
Definition: shellext.h:65
PFILE_OBJECT FileObject
Definition: cc.h:179
#define DPRINT
Definition: sndvol32.h:71
LIST_ENTRY DirtyVacbListHead
Definition: view.c:41

Referenced by CcWriteBehind(), and NtSetSystemPowerState().

◆ CcRosFlushVacb()

NTSTATUS CcRosFlushVacb ( _In_ PROS_VACB  Vacb,
_Out_opt_ PIO_STATUS_BLOCK  Iosb 
)

Definition at line 159 of file view.c.

162 {
164  BOOLEAN HaveLock = FALSE;
165  PROS_SHARED_CACHE_MAP SharedCacheMap = Vacb->SharedCacheMap;
166 
167  CcRosUnmarkDirtyVacb(Vacb, TRUE);
168 
169  /* Lock for flush, if we are not already the top-level */
171  {
172  Status = FsRtlAcquireFileForCcFlushEx(Vacb->SharedCacheMap->FileObject);
173  if (!NT_SUCCESS(Status))
174  goto quit;
175  HaveLock = TRUE;
176  }
177 
178  Status = MmFlushSegment(SharedCacheMap->FileObject->SectionObjectPointer,
179  &Vacb->FileOffset,
181  Iosb);
182 
183  if (HaveLock)
184  {
185  FsRtlReleaseFileForCcFlush(Vacb->SharedCacheMap->FileObject);
186  }
187 
188 quit:
189  if (!NT_SUCCESS(Status))
190  CcRosMarkDirtyVacb(Vacb);
191  else
192  {
193  /* Update VDL */
194  if (SharedCacheMap->ValidDataLength.QuadPart < (Vacb->FileOffset.QuadPart + VACB_MAPPING_GRANULARITY))
195  {
196  SharedCacheMap->ValidDataLength.QuadPart = Vacb->FileOffset.QuadPart + VACB_MAPPING_GRANULARITY;
197  }
198  }
199 
200  return Status;
201 }
#define TRUE
Definition: types.h:120
void quit(int argc, const char *argv[])
Definition: cmds.c:1606
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI MmFlushSegment(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_opt_ PLARGE_INTEGER Offset, _In_ ULONG Length, _Out_opt_ PIO_STATUS_BLOCK Iosb)
Definition: section.c:4829
#define FALSE
Definition: types.h:117
VOID CcRosUnmarkDirtyVacb(PROS_VACB Vacb, BOOLEAN LockViews)
Definition: view.c:564
unsigned char BOOLEAN
Status
Definition: gdiplustypes.h:24
return Iosb
Definition: create.c:4402
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
VOID CcRosMarkDirtyVacb(PROS_VACB Vacb)
Definition: view.c:528
#define VACB_MAPPING_GRANULARITY
NTSTATUS NTAPI FsRtlAcquireFileForCcFlushEx(IN PFILE_OBJECT FileObject)
Definition: fastio.c:1692
VOID NTAPI FsRtlReleaseFileForCcFlush(IN PFILE_OBJECT FileObject)
Definition: fastio.c:1765
LARGE_INTEGER ValidDataLength
Definition: cc.h:178
PFILE_OBJECT FileObject
Definition: cc.h:179
#define FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by CcFlushCache(), and CcRosFlushDirtyPages().

◆ CcRosGetVacb()

NTSTATUS CcRosGetVacb ( PROS_SHARED_CACHE_MAP  SharedCacheMap,
LONGLONG  FileOffset,
PROS_VACB Vacb 
)

Definition at line 863 of file view.c.

867 {
870  ULONG Refs;
871  KIRQL OldIrql;
872 
873  ASSERT(SharedCacheMap);
874 
875  DPRINT("CcRosGetVacb()\n");
876 
877  /*
878  * Look for a VACB already mapping the same data.
879  */
880  current = CcRosLookupVacb(SharedCacheMap, FileOffset);
881  if (current == NULL)
882  {
883  /*
884  * Otherwise create a new VACB.
885  */
886  Status = CcRosCreateVacb(SharedCacheMap, FileOffset, &current);
887  if (!NT_SUCCESS(Status))
888  {
889  return Status;
890  }
891  }
892 
894 
896 
897  /* Move to the tail of the LRU list */
898  RemoveEntryList(&current->VacbLruListEntry);
899  InsertTailList(&VacbLruListHead, &current->VacbLruListEntry);
900 
902 
903  /*
904  * Return the VACB to the caller.
905  */
906  *Vacb = current;
907 
908  ASSERT(Refs > 1);
909 
910  return STATUS_SUCCESS;
911 }
Definition: cc.h:206
LONG NTSTATUS
Definition: precomp.h:26
static LIST_ENTRY VacbLruListHead
Definition: view.c:42
#define InsertTailList(ListHead, Entry)
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define CcRosVacbGetRefCount(vacb)
Definition: cc.h:510
KIRQL OldIrql
Definition: mm.h:1502
Status
Definition: gdiplustypes.h:24
#define ASSERT(a)
Definition: mode.c:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID FASTCALL KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql)
Definition: spinlock.c:154
struct task_struct * current
Definition: linux.c:32
KIRQL FASTCALL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
Definition: spinlock.c:108
static NTSTATUS CcRosCreateVacb(PROS_SHARED_CACHE_MAP SharedCacheMap, LONGLONG FileOffset, PROS_VACB *Vacb)
Definition: view.c:682
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:159
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
PROS_VACB CcRosLookupVacb(PROS_SHARED_CACHE_MAP SharedCacheMap, LONGLONG FileOffset)
Definition: view.c:485
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71

Referenced by CcCopyRead(), CcCopyWrite(), CcMapData(), CcpPinData(), CcRosRequestVacb(), and CcZeroData().

◆ CcRosInitializeFileCache()

NTSTATUS CcRosInitializeFileCache ( PFILE_OBJECT  FileObject,
PCC_FILE_SIZES  FileSizes,
BOOLEAN  PinAccess,
PCACHE_MANAGER_CALLBACKS  CallBacks,
PVOID  LazyWriterContext 
)

Definition at line 1166 of file view.c.

1175 {
1176  KIRQL OldIrql;
1178  PROS_SHARED_CACHE_MAP SharedCacheMap;
1179 
1180  DPRINT("CcRosInitializeFileCache(FileObject 0x%p)\n", FileObject);
1181 
1183 
1184  Allocated = FALSE;
1185  SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
1186  if (SharedCacheMap == NULL)
1187  {
1188  Allocated = TRUE;
1189  SharedCacheMap = ExAllocateFromNPagedLookasideList(&SharedCacheMapLookasideList);
1190  if (SharedCacheMap == NULL)
1191  {
1193  }
1194  RtlZeroMemory(SharedCacheMap, sizeof(*SharedCacheMap));
1195  SharedCacheMap->NodeTypeCode = NODE_TYPE_SHARED_MAP;
1196  SharedCacheMap->NodeByteSize = sizeof(*SharedCacheMap);
1197  SharedCacheMap->FileObject = FileObject;
1198  SharedCacheMap->Callbacks = CallBacks;
1199  SharedCacheMap->LazyWriteContext = LazyWriterContext;
1200  SharedCacheMap->SectionSize = FileSizes->AllocationSize;
1201  SharedCacheMap->FileSize = FileSizes->FileSize;
1202  SharedCacheMap->ValidDataLength = FileSizes->ValidDataLength;
1203  SharedCacheMap->PinAccess = PinAccess;
1204  SharedCacheMap->DirtyPageThreshold = 0;
1205  SharedCacheMap->DirtyPages = 0;
1206  InitializeListHead(&SharedCacheMap->PrivateList);
1207  KeInitializeSpinLock(&SharedCacheMap->CacheMapLock);
1208  InitializeListHead(&SharedCacheMap->CacheMapVacbListHead);
1209  InitializeListHead(&SharedCacheMap->BcbList);
1210 
1211  SharedCacheMap->Flags = SHARED_CACHE_MAP_IN_CREATION;
1212 
1215  NULL,
1216  KernelMode);
1217 
1218  FileObject->SectionObjectPointer->SharedCacheMap = SharedCacheMap;
1219 
1220  //CcRosTraceCacheMap(SharedCacheMap, TRUE);
1221  }
1222  else if (SharedCacheMap->Flags & SHARED_CACHE_MAP_IN_CREATION)
1223  {
1224  /* The shared cache map is being created somewhere else. Wait for that to happen */
1225  KEVENT Waiter;
1226  PKEVENT PreviousWaiter = SharedCacheMap->CreateEvent;
1227 
1229  SharedCacheMap->CreateEvent = &Waiter;
1230 
1232 
1234 
1235  if (PreviousWaiter)
1236  KeSetEvent(PreviousWaiter, IO_NO_INCREMENT, FALSE);
1237 
1239  }
1240 
1241  if (FileObject->PrivateCacheMap == NULL)
1242  {
1243  PPRIVATE_CACHE_MAP PrivateMap;
1244 
1245  /* Allocate the private cache map for this handle */
1246  if (SharedCacheMap->PrivateCacheMap.NodeTypeCode != 0)
1247  {
1249  }
1250  else
1251  {
1252  PrivateMap = &SharedCacheMap->PrivateCacheMap;
1253  }
1254 
1255  if (PrivateMap == NULL)
1256  {
1257  /* If we also allocated the shared cache map for this file, kill it */
1258  if (Allocated)
1259  {
1260  RemoveEntryList(&SharedCacheMap->SharedCacheMapLinks);
1261 
1262  FileObject->SectionObjectPointer->SharedCacheMap = NULL;
1264  ExFreeToNPagedLookasideList(&SharedCacheMapLookasideList, SharedCacheMap);
1265  }
1266 
1269  }
1270 
1271  /* Initialize it */
1272  RtlZeroMemory(PrivateMap, sizeof(PRIVATE_CACHE_MAP));
1273  PrivateMap->NodeTypeCode = NODE_TYPE_PRIVATE_MAP;
1274  PrivateMap->ReadAheadMask = PAGE_SIZE - 1;
1275  PrivateMap->FileObject = FileObject;
1277 
1278  /* Link it to the file */
1279  KeAcquireSpinLockAtDpcLevel(&SharedCacheMap->CacheMapLock);
1280  InsertTailList(&SharedCacheMap->PrivateList, &PrivateMap->PrivateLinks);
1281  KeReleaseSpinLockFromDpcLevel(&SharedCacheMap->CacheMapLock);
1282 
1283  FileObject->PrivateCacheMap = PrivateMap;
1284  SharedCacheMap->OpenCount++;
1285  }
1286 
1288 
1289  /* Create the section */
1290  if (Allocated)
1291  {
1292  NTSTATUS Status;
1293 
1294  ASSERT(SharedCacheMap->Section == NULL);
1295 
1297  &SharedCacheMap->Section,
1299  NULL,
1300  &SharedCacheMap->SectionSize,
1302  SEC_RESERVE,
1303  NULL,
1304  FileObject);
1305 
1307 
1308  if (!NT_SUCCESS(Status))
1309  {
1311  return Status;
1312  }
1313 
1315 
1317  SharedCacheMap->Flags &= ~SHARED_CACHE_MAP_IN_CREATION;
1318 
1319  if (SharedCacheMap->CreateEvent)
1320  {
1321  KeSetEvent(SharedCacheMap->CreateEvent, IO_NO_INCREMENT, FALSE);
1322  SharedCacheMap->CreateEvent = NULL;
1323  }
1324 
1326  }
1327 
1328  return STATUS_SUCCESS;
1329 }
BOOLEAN PinAccess
Definition: cc.h:194
LIST_ENTRY PrivateList
Definition: cc.h:187
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define FILE_ALL_ACCESS
Definition: nt_native.h:651
ULONG OpenCount
Definition: cc.h:174
LARGE_INTEGER SectionSize
Definition: cc.h:177
#define SHARED_CACHE_MAP_IN_CREATION
Definition: cc.h:203
#define TRUE
Definition: types.h:120
LIST_ENTRY SharedCacheMapLinks
Definition: cc.h:181
VOID NTAPI KeAcquireSpinLockAtDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:198
LONG NTSTATUS
Definition: precomp.h:26
LIST_ENTRY BcbList
Definition: cc.h:176
static CC_FILE_SIZES FileSizes
#define InsertTailList(ListHead, Entry)
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
ULONG ReadAheadMask
Definition: cctypes.h:75
LARGE_INTEGER FileSize
Definition: cctypes.h:16
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define SECTION_ALL_ACCESS
Definition: nt_native.h:1293
#define FALSE
Definition: types.h:117
#define SEC_RESERVE
Definition: nt_native.h:1323
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
unsigned char BOOLEAN
IN PFCB IN VBO OUT PLBO OUT PULONG OUT PBOOLEAN Allocated
Definition: fatprocs.h:306
NTSTATUS NTAPI ObReferenceObjectByPointer(IN PVOID Object, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode)
Definition: obref.c:381
PCACHE_MANAGER_CALLBACKS Callbacks
Definition: cc.h:185
LIST_ENTRY CcCleanSharedCacheMapList
Definition: view.c:59
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
KIRQL OldIrql
Definition: mm.h:1502
LIST_ENTRY CacheMapVacbListHead
Definition: cc.h:193
KSPIN_LOCK ReadAheadSpinLock
Definition: cctypes.h:83
Status
Definition: gdiplustypes.h:24
static NPAGED_LOOKASIDE_LIST SharedCacheMapLookasideList
Definition: view.c:45
#define ASSERT(a)
Definition: mode.c:44
LIST_ENTRY PrivateLinks
Definition: cctypes.h:84
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS NTAPI MmCreateSection(OUT PVOID *Section, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN PLARGE_INTEGER MaximumSize, IN ULONG SectionPageProtection, IN ULONG AllocationAttributes, IN HANDLE FileHandle OPTIONAL, IN PFILE_OBJECT FileObject OPTIONAL)
Definition: section.c:4509
VOID NTAPI KeReleaseSpinLockFromDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:221
#define ObDereferenceObject
Definition: obfuncs.h:203
VOID FASTCALL KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql)
Definition: spinlock.c:154
CSHORT NodeTypeCode
Definition: cc.h:172
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
NTSTATUS CcRosReleaseFileCache(PFILE_OBJECT FileObject)
Definition: view.c:1110
LARGE_INTEGER ValidDataLength
Definition: cctypes.h:17
#define PAGE_SIZE
Definition: env_spec_w32.h:49
KIRQL FASTCALL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
Definition: spinlock.c:108
PFILE_OBJECT FileObject
Definition: cctypes.h:76
CSHORT NodeByteSize
Definition: cc.h:173
#define NODE_TYPE_PRIVATE_MAP
Definition: cc.h:287
PRIVATE_CACHE_MAP PrivateCacheMap
Definition: cc.h:190
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
LARGE_INTEGER AllocationSize
Definition: cctypes.h:15
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define NULL
Definition: types.h:112
PVOID LazyWriteContext
Definition: cc.h:186
LARGE_INTEGER FileSize
Definition: cc.h:175
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
LARGE_INTEGER ValidDataLength
Definition: cc.h:178
#define TAG_PRIVATE_CACHE_MAP
Definition: tag.h:7
PKEVENT CreateEvent
Definition: cc.h:184
#define STATUS_SUCCESS
Definition: shellext.h:65
KSPIN_LOCK CacheMapLock
Definition: cc.h:195
CSHORT NodeTypeCode
Definition: cctypes.h:71
PFILE_OBJECT FileObject
Definition: cc.h:179
#define DPRINT
Definition: sndvol32.h:71
ULONG DirtyPageThreshold
Definition: cc.h:188
#define NODE_TYPE_SHARED_MAP
Definition: cc.h:288
ULONG DirtyPages
Definition: cc.h:180
#define PAGE_READWRITE
Definition: nt_native.h:1304

Referenced by CcInitializeCacheMap().

◆ CcRosInternalFreeVacb()

NTSTATUS CcRosInternalFreeVacb ( IN PROS_VACB  Vacb)

Referenced by CcRosVacbDecRefCount().

◆ CcRosLookupVacb()

PROS_VACB CcRosLookupVacb ( PROS_SHARED_CACHE_MAP  SharedCacheMap,
LONGLONG  FileOffset 
)

Definition at line 485 of file view.c.

488 {
489  PLIST_ENTRY current_entry;
491  KIRQL oldIrql;
492 
493  ASSERT(SharedCacheMap);
494 
495  DPRINT("CcRosLookupVacb(SharedCacheMap 0x%p, FileOffset %I64u)\n",
496  SharedCacheMap, FileOffset);
497 
499  KeAcquireSpinLockAtDpcLevel(&SharedCacheMap->CacheMapLock);
500 
501  current_entry = SharedCacheMap->CacheMapVacbListHead.Flink;
502  while (current_entry != &SharedCacheMap->CacheMapVacbListHead)
503  {
504  current = CONTAINING_RECORD(current_entry,
505  ROS_VACB,
506  CacheMapVacbListEntry);
507  if (IsPointInRange(current->FileOffset.QuadPart,
509  FileOffset))
510  {
514  return current;
515  }
516  if (current->FileOffset.QuadPart > FileOffset)
517  break;
518  current_entry = current_entry->Flink;
519  }
520 
523 
524  return NULL;
525 }
Definition: cc.h:206
VOID NTAPI KeAcquireSpinLockAtDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:198
UCHAR KIRQL
Definition: env_spec_w32.h:591
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
LIST_ENTRY CacheMapVacbListHead
Definition: cc.h:193
FORCEINLINE BOOLEAN IsPointInRange(_In_ LONGLONG Offset1, _In_ LONGLONG Length1, _In_ LONGLONG Point)
Definition: cc.h:461
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define ASSERT(a)
Definition: mode.c:44
VOID NTAPI KeReleaseSpinLockFromDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:221
VOID FASTCALL KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql)
Definition: spinlock.c:154
struct task_struct * current
Definition: linux.c:32
#define CcRosVacbIncRefCount(vacb)
Definition: cc.h:495
Definition: typedefs.h:119
KIRQL FASTCALL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
Definition: spinlock.c:108
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:159
#define NULL
Definition: types.h:112
#define VACB_MAPPING_GRANULARITY
KSPIN_LOCK CacheMapLock
Definition: cc.h:195
#define DPRINT
Definition: sndvol32.h:71

Referenced by CcFlushCache(), and CcRosGetVacb().

◆ CcRosMarkDirtyVacb()

VOID CcRosMarkDirtyVacb ( PROS_VACB  Vacb)

Definition at line 528 of file view.c.

530 {
531  KIRQL oldIrql;
532  PROS_SHARED_CACHE_MAP SharedCacheMap;
533 
534  SharedCacheMap = Vacb->SharedCacheMap;
535 
537  KeAcquireSpinLockAtDpcLevel(&SharedCacheMap->CacheMapLock);
538 
539  ASSERT(!Vacb->Dirty);
540 
542  /* FIXME: There is no reason to account for the whole VACB. */
545  CcRosVacbIncRefCount(Vacb);
546 
547  /* Move to the tail of the LRU list */
550 
551  Vacb->Dirty = TRUE;
552 
554 
555  /* Schedule a lazy writer run to now that we have dirty VACB */
556  if (!LazyWriter.ScanActive)
557  {
559  }
561 }
#define TRUE
Definition: types.h:120
VOID NTAPI KeAcquireSpinLockAtDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:198
static LIST_ENTRY VacbLruListHead
Definition: view.c:42
#define InsertTailList(ListHead, Entry)
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
UCHAR KIRQL
Definition: env_spec_w32.h:591
LAZY_WRITER LazyWriter
Definition: lazywrite.c:37
#define FALSE
Definition: types.h:117
PROS_SHARED_CACHE_MAP SharedCacheMap
Definition: cc.h:226
#define ASSERT(a)
Definition: mode.c:44
VOID NTAPI KeReleaseSpinLockFromDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:221
BOOLEAN ScanActive
Definition: cc.h:246
VOID FASTCALL KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql)
Definition: spinlock.c:154
BOOLEAN Dirty
Definition: cc.h:211
ULONG CcTotalDirtyPages
Definition: view.c:56
#define CcRosVacbIncRefCount(vacb)
Definition: cc.h:495
#define PAGE_SIZE
Definition: env_spec_w32.h:49
KIRQL FASTCALL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
Definition: spinlock.c:108
VOID CcScheduleLazyWriteScan(IN BOOLEAN NoDelay)
Definition: lazywrite.c:200
#define VACB_MAPPING_GRANULARITY
LIST_ENTRY DirtyVacbListEntry
Definition: cc.h:218
KSPIN_LOCK CacheMapLock
Definition: cc.h:195
LIST_ENTRY DirtyVacbListHead
Definition: view.c:41
ULONG DirtyPages
Definition: cc.h:180
LIST_ENTRY VacbLruListEntry
Definition: cc.h:220

Referenced by CcRosFlushVacb(), CcRosReleaseVacb(), and CcSetDirtyPinnedData().

◆ CcRosReferenceCache()

VOID CcRosReferenceCache ( PFILE_OBJECT  FileObject)

◆ CcRosReleaseFileCache()

NTSTATUS CcRosReleaseFileCache ( PFILE_OBJECT  FileObject)

Definition at line 1110 of file view.c.

1116 {
1117  KIRQL OldIrql;
1118  PPRIVATE_CACHE_MAP PrivateMap;
1119  PROS_SHARED_CACHE_MAP SharedCacheMap;
1120 
1122 
1123  if (FileObject->SectionObjectPointer->SharedCacheMap != NULL)
1124  {
1125  SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
1126 
1127  /* Closing the handle, so kill the private cache map
1128  * Before you event try to remove it from FO, always
1129  * lock the master lock, to be sure not to race
1130  * with a potential read ahead ongoing!
1131  */
1132  PrivateMap = FileObject->PrivateCacheMap;
1133  FileObject->PrivateCacheMap = NULL;
1134 
1135  if (PrivateMap != NULL)
1136  {
1137  /* Remove it from the file */
1138  KeAcquireSpinLockAtDpcLevel(&SharedCacheMap->CacheMapLock);
1139  RemoveEntryList(&PrivateMap->PrivateLinks);
1140  KeReleaseSpinLockFromDpcLevel(&SharedCacheMap->CacheMapLock);
1141 
1142  /* And free it. */
1143  if (PrivateMap != &SharedCacheMap->PrivateCacheMap)
1144  {
1146  }
1147  else
1148  {
1149  PrivateMap->NodeTypeCode = 0;
1150  }
1151 
1152  ASSERT(SharedCacheMap->OpenCount > 0);
1153 
1154  SharedCacheMap->OpenCount--;
1155  if (SharedCacheMap->OpenCount == 0)
1156  {
1157  CcRosDeleteFileCache(FileObject, SharedCacheMap, &OldIrql);
1158  }
1159  }
1160  }
1162  return STATUS_SUCCESS;
1163 }
ULONG OpenCount
Definition: cc.h:174
VOID NTAPI KeAcquireSpinLockAtDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:198
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
UCHAR KIRQL
Definition: env_spec_w32.h:591
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
KIRQL OldIrql
Definition: mm.h:1502
#define ASSERT(a)
Definition: mode.c:44
LIST_ENTRY PrivateLinks
Definition: cctypes.h:84
VOID NTAPI KeReleaseSpinLockFromDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:221
VOID FASTCALL KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql)
Definition: spinlock.c:154
KIRQL FASTCALL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
Definition: spinlock.c:108
PRIVATE_CACHE_MAP PrivateCacheMap
Definition: cc.h:190
static NTSTATUS CcRosDeleteFileCache(PFILE_OBJECT FileObject, PROS_SHARED_CACHE_MAP SharedCacheMap, PKIRQL OldIrql)
Definition: view.c:205
#define NULL
Definition: types.h:112
#define TAG_PRIVATE_CACHE_MAP
Definition: tag.h:7
#define STATUS_SUCCESS
Definition: shellext.h:65
KSPIN_LOCK CacheMapLock
Definition: cc.h:195
CSHORT NodeTypeCode
Definition: cctypes.h:71
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

Referenced by CcRosInitializeFileCache(), and CcUninitializeCacheMap().

◆ CcRosReleaseVacb()

NTSTATUS CcRosReleaseVacb ( PROS_SHARED_CACHE_MAP  SharedCacheMap,
PROS_VACB  Vacb,
BOOLEAN  Dirty,
BOOLEAN  Mapped 
)

Definition at line 453 of file view.c.

458 {
459  ULONG Refs;
460  ASSERT(SharedCacheMap);
461 
462  DPRINT("CcRosReleaseVacb(SharedCacheMap 0x%p, Vacb 0x%p)\n", SharedCacheMap, Vacb);
463 
464  if (Dirty && !Vacb->Dirty)
465  {
466  CcRosMarkDirtyVacb(Vacb);
467  }
468 
469  if (Mapped)
470  {
471  if (InterlockedIncrement((PLONG)&Vacb->MappedCount) == 1)
472  {
473  CcRosVacbIncRefCount(Vacb);
474  }
475  }
476 
477  Refs = CcRosVacbDecRefCount(Vacb);
478  ASSERT(Refs > 0);
479 
480  return STATUS_SUCCESS;
481 }
ULONG MappedCount
Definition: cc.h:214
#define ASSERT(a)
Definition: mode.c:44
FORCEINLINE ULONG CcRosVacbDecRefCount(PROS_VACB vacb)
Definition: cc.h:498
VOID CcRosMarkDirtyVacb(PROS_VACB Vacb)
Definition: view.c:528
BOOLEAN Dirty
Definition: cc.h:211
#define CcRosVacbIncRefCount(vacb)
Definition: cc.h:495
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
signed int * PLONG
Definition: retypes.h:5

Referenced by CcCopyRead(), CcCopyWrite(), CcFlushCache(), CcMapData(), CcpDereferenceBcb(), CcPerformReadAhead(), CcpGetAppropriateBcb(), CcpPinData(), CcUnpinRepinnedBcb(), and CcZeroData().

◆ CcRosRequestVacb()

NTSTATUS CcRosRequestVacb ( PROS_SHARED_CACHE_MAP  SharedCacheMap,
LONGLONG  FileOffset,
PROS_VACB Vacb 
)

Definition at line 914 of file view.c.

921 {
922 
923  ASSERT(SharedCacheMap);
924 
926  {
927  DPRINT1("Bad fileoffset %I64x should be multiple of %x",
929  KeBugCheck(CACHE_MANAGER);
930  }
931 
932  return CcRosGetVacb(SharedCacheMap,
933  FileOffset,
934  Vacb);
935 }
NTSTATUS CcRosGetVacb(PROS_SHARED_CACHE_MAP SharedCacheMap, LONGLONG FileOffset, PROS_VACB *Vacb)
Definition: view.c:863
DECLSPEC_NORETURN VOID NTAPI KeBugCheck(ULONG BugCheckCode)
Definition: bug.c:1427
#define ASSERT(a)
Definition: mode.c:44
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:159
#define DPRINT1
Definition: precomp.h:8
#define VACB_MAPPING_GRANULARITY

Referenced by CcPerformReadAhead().

◆ CcRosUnmarkDirtyVacb()

VOID CcRosUnmarkDirtyVacb ( PROS_VACB  Vacb,
BOOLEAN  LockViews 
)

Definition at line 564 of file view.c.

567 {
568  KIRQL oldIrql;
569  PROS_SHARED_CACHE_MAP SharedCacheMap;
570 
571  SharedCacheMap = Vacb->SharedCacheMap;
572 
573  if (LockViews)
574  {
576  KeAcquireSpinLockAtDpcLevel(&SharedCacheMap->CacheMapLock);
577  }
578 
579  ASSERT(Vacb->Dirty);
580 
581  Vacb->Dirty = FALSE;
582 
585 
588 
589  CcRosVacbDecRefCount(Vacb);
590 
591  if (LockViews)
592  {
595  }
596 }
VOID NTAPI KeAcquireSpinLockAtDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:198
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define FALSE
Definition: types.h:117
PROS_SHARED_CACHE_MAP SharedCacheMap
Definition: cc.h:226
#define ASSERT(a)
Definition: mode.c:44
VOID NTAPI KeReleaseSpinLockFromDpcLevel(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:221
VOID FASTCALL KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql)
Definition: spinlock.c:154
FORCEINLINE ULONG CcRosVacbDecRefCount(PROS_VACB vacb)
Definition: cc.h:498
BOOLEAN Dirty
Definition: cc.h:211
ULONG CcTotalDirtyPages
Definition: view.c:56
#define PAGE_SIZE
Definition: env_spec_w32.h:49
KIRQL FASTCALL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
Definition: spinlock.c:108
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define VACB_MAPPING_GRANULARITY
LIST_ENTRY DirtyVacbListEntry
Definition: cc.h:218
KSPIN_LOCK CacheMapLock
Definition: cc.h:195
ULONG DirtyPages
Definition: cc.h:180

Referenced by CcPurgeCacheSection(), CcRosDeleteFileCache(), and CcRosFlushVacb().

◆ CcRosVacbDecRefCount()

FORCEINLINE ULONG CcRosVacbDecRefCount ( PROS_VACB  vacb)

Definition at line 498 of file cc.h.

500 {
501  ULONG Refs;
502 
503  Refs = InterlockedDecrement((PLONG)&vacb->ReferenceCount);
504  if (Refs == 0)
505  {
506  CcRosInternalFreeVacb(vacb);
507  }
508  return Refs;
509 }
volatile ULONG ReferenceCount
Definition: cc.h:224
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS CcRosInternalFreeVacb(IN PROS_VACB Vacb)
signed int * PLONG
Definition: retypes.h:5

Referenced by CcPurgeCacheSection(), CcRosCreateVacb(), CcRosDeleteFileCache(), CcRosFlushDirtyPages(), CcRosFreeUnusedVacb(), CcRosReleaseVacb(), and CcRosUnmarkDirtyVacb().

◆ CcScanDpc()

VOID NTAPI CcScanDpc ( PKDPC  Dpc,
PVOID  DeferredContext,
PVOID  SystemArgument1,
PVOID  SystemArgument2 
)

◆ CcScheduleLazyWriteScan()

VOID CcScheduleLazyWriteScan ( BOOLEAN  NoDelay)

◆ CcShutdownLazyWriter()

VOID NTAPI CcShutdownLazyWriter ( VOID  )

◆ CcShutdownSystem()

VOID NTAPI CcShutdownSystem ( VOID  )

Definition at line 299 of file cachesub.c.

300 {
301  ULONG i, Result;
303 
304  DPRINT1("CC: Shutdown\n");
305 
306  for (i = 0; i < CACHE_NUM_SECTIONS; i++)
307  {
309  if (Bcb->SectionObject)
310  {
311  DPRINT1("Evicting #%02x %08x%08x %wZ\n",
312  i,
313  Bcb->FileOffset.u.HighPart,
314  Bcb->FileOffset.u.LowPart,
315  &MmGetFileObjectForSection((PROS_SECTION_OBJECT)Bcb->SectionObject)->FileName);
316 
317  CcpFlushCache(Bcb->Map, NULL, 0, NULL, TRUE);
318  Bcb->Dirty = FALSE;
319  }
320  }
321 
322  /* Evict all section pages */
323  Status = MiRosTrimCache(~0, 0, &Result);
324 
325  DPRINT1("Done (Evicted %d, Status %x)\n", Result, Status);
326 }
PFILE_OBJECT NTAPI MmGetFileObjectForSection(IN PVOID Section)
Definition: section.c:1734
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:411
#define TRUE
Definition: types.h:120
#define CACHE_NUM_SECTIONS
Definition: newcc.h:125
LONG NTSTATUS
Definition: precomp.h:26
#define CcpFlushCache(M, F, L, I, D)
Definition: newcc.h:91
NTSTATUS MiRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed)
Definition: swapout.c:633
Definition: newcc.h:3
NOCC_BCB CcCacheSections[CACHE_NUM_SECTIONS]
Definition: pinsup.c:98
#define FALSE
Definition: types.h:117
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
Status
Definition: gdiplustypes.h:24
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1

Referenced by PopGracefulShutdown().

◆ CcWorkerThread()

VOID NTAPI CcWorkerThread ( PVOID  Parameter)

◆ DoRangesIntersect()

FORCEINLINE BOOLEAN DoRangesIntersect ( _In_ LONGLONG  Offset1,
_In_ LONGLONG  Length1,
_In_ LONGLONG  Offset2,
_In_ LONGLONG  Length2 
)

Definition at line 446 of file cc.h.

451 {
452  if (Offset1 + Length1 <= Offset2)
453  return FALSE;
454  if (Offset2 + Length2 <= Offset1)
455  return FALSE;
456  return TRUE;
457 }
#define TRUE
Definition: types.h:120
INT Length2
Definition: FsRtlDissect.c:16
INT Length1
Definition: FsRtlDissect.c:15
#define FALSE
Definition: types.h:117
INT Offset1
Definition: FsRtlDissect.c:13
INT Offset2
Definition: FsRtlDissect.c:14

Referenced by IsPointInRange().

◆ IsPointInRange()

FORCEINLINE BOOLEAN IsPointInRange ( _In_ LONGLONG  Offset1,
_In_ LONGLONG  Length1,
_In_ LONGLONG  Point 
)

Definition at line 461 of file cc.h.

465 {
466  return DoRangesIntersect(Offset1, Length1, Point, 1);
467 }
INT Length1
Definition: FsRtlDissect.c:15
FORCEINLINE BOOLEAN DoRangesIntersect(_In_ LONGLONG Offset1, _In_ LONGLONG Length1, _In_ LONGLONG Offset2, _In_ LONGLONG Length2)
Definition: cc.h:446
INT Offset1
Definition: FsRtlDissect.c:13

Referenced by CcRosCreateVacb(), and CcRosLookupVacb().

Variable Documentation

◆ CcDataFlushes

ULONG CcDataFlushes

Definition at line 44 of file copy.c.

Referenced by IoSynchronousPageWrite(), and QSI_DEF().

◆ CcDataPages

ULONG CcDataPages

Definition at line 43 of file copy.c.

Referenced by IoSynchronousPageWrite(), and QSI_DEF().

◆ CcDeferredWrites

LIST_ENTRY CcDeferredWrites

◆ CcDeferredWriteSpinLock

KSPIN_LOCK CcDeferredWriteSpinLock

Definition at line 58 of file view.c.

Referenced by CcCanIWrite(), CcDeferWrite(), CcInitView(), and CcPostDeferredWrites().

◆ CcDirtyPageThreshold

ULONG CcDirtyPageThreshold

Definition at line 55 of file view.c.

Referenced by CcCanIWrite(), and CcInitializeCacheManager().

◆ CcExpressWorkQueue

LIST_ENTRY CcExpressWorkQueue

Definition at line 39 of file lazywrite.c.

Referenced by CcInitializeCacheManager(), CcScheduleReadAhead(), and CcWorkerThread().

◆ CcIdleDelay

LARGE_INTEGER CcIdleDelay

Definition at line 46 of file lazywrite.c.

Referenced by CcCanIWrite(), and CcScheduleLazyWriteScan().

◆ CcIdleWorkerThreadList

LIST_ENTRY CcIdleWorkerThreadList

Definition at line 41 of file lazywrite.c.

Referenced by CcInitializeCacheManager(), CcPostWorkQueue(), and CcWorkerThread().

◆ CcLazyWriteIos

ULONG CcLazyWriteIos

Definition at line 21 of file lazywrite.c.

Referenced by CcWriteBehind(), and QSI_DEF().

◆ CcLazyWritePages

ULONG CcLazyWritePages

Definition at line 20 of file lazywrite.c.

Referenced by CcWriteBehind(), and QSI_DEF().

◆ CcMapDataNoWait

ULONG CcMapDataNoWait

Definition at line 29 of file pin.c.

Referenced by CcMapData(), and QSI_DEF().

◆ CcMapDataWait

ULONG CcMapDataWait

Definition at line 28 of file pin.c.

Referenced by CcMapData(), and QSI_DEF().

◆ CcNumberWorkerThreads

ULONG CcNumberWorkerThreads

Definition at line 48 of file lazywrite.c.

Referenced by CcInitializeCacheManager().

◆ CcPinMappedDataCount

ULONG CcPinMappedDataCount

Definition at line 32 of file pin.c.

Referenced by CcPinMappedData(), and QSI_DEF().

◆ CcPinReadNoWait

ULONG CcPinReadNoWait

Definition at line 31 of file pin.c.

Referenced by CcPinRead(), and QSI_DEF().

◆ CcPinReadWait

ULONG CcPinReadWait

Definition at line 30 of file pin.c.

Referenced by CcPinRead(), and QSI_DEF().

◆ CcPostTickWorkQueue

LIST_ENTRY CcPostTickWorkQueue

◆ CcRegularWorkQueue

LIST_ENTRY CcRegularWorkQueue

Definition at line 40 of file lazywrite.c.

Referenced by CcInitializeCacheManager(), CcLazyWriteScan(), CcScanDpc(), and CcWorkerThread().

◆ CcRosTraceLevel

ULONG CcRosTraceLevel

Definition at line 31 of file copy.c.

◆ CcTotalDirtyPages

ULONG CcTotalDirtyPages

◆ CcTwilightLookasideList

◆ DirtyVacbListHead

LIST_ENTRY DirtyVacbListHead

Definition at line 41 of file view.c.

Referenced by CcInitView(), CcIsThereDirtyData(), CcRosFlushDirtyPages(), and CcRosMarkDirtyVacb().

◆ LazyWriter