mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
[NTOSKRNL] Implement CcIsThereDirtyData()
This commit is contained in:
parent
4a2ad113e5
commit
c779dbd4c5
3 changed files with 39 additions and 4 deletions
|
@ -111,17 +111,51 @@ CcInitializeCacheMap (
|
|||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
CcIsThereDirtyData (
|
||||
IN PVPB Vpb)
|
||||
{
|
||||
PROS_VACB Vacb;
|
||||
PLIST_ENTRY Entry;
|
||||
/* Assume no dirty data */
|
||||
BOOLEAN Dirty = FALSE;
|
||||
|
||||
CCTRACE(CC_API_DEBUG, "Vpb=%p\n", Vpb);
|
||||
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
KeAcquireGuardedMutex(&ViewLock);
|
||||
|
||||
/* Browse dirty VACBs */
|
||||
for (Entry = DirtyVacbListHead.Flink; Entry != &DirtyVacbListHead; Entry = Entry->Flink)
|
||||
{
|
||||
Vacb = CONTAINING_RECORD(Entry, ROS_VACB, DirtyVacbListEntry);
|
||||
/* Look for these associated with our volume */
|
||||
if (Vacb->SharedCacheMap->FileObject->Vpb != Vpb)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* From now on, we are associated with our VPB */
|
||||
|
||||
/* Temporary files are not counted as dirty */
|
||||
if (BooleanFlagOn(Vacb->SharedCacheMap->FileObject->Flags, FO_TEMPORARY_FILE))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* A single dirty VACB is enough to have dirty data */
|
||||
if (Vacb->Dirty)
|
||||
{
|
||||
Dirty = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
KeReleaseGuardedMutex(&ViewLock);
|
||||
|
||||
return Dirty;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
static LIST_ENTRY DirtyVacbListHead;
|
||||
LIST_ENTRY DirtyVacbListHead;
|
||||
static LIST_ENTRY VacbLruListHead;
|
||||
ULONG DirtyPageCount = 0;
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
// Global Cc Data
|
||||
//
|
||||
extern ULONG CcRosTraceLevel;
|
||||
extern LIST_ENTRY DirtyVacbListHead;
|
||||
|
||||
typedef struct _PF_SCENARIO_ID
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue