Well what you can do is ENSURE there is no dirty data for a file in your
cleanup handler, and then do whatever post-processing is necessary. To
do this, take both FCB resources exclusive and then flush the NT cache
for the file using CcFlushCache/MmFlushImageSection/CcPurgeCacheSection.
Now it’s been guaranteed that all modified pages have been flushed to
disk. Then perform your post-processing before releasing the FCB
resources.
- Nicholas Ryan
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
xxxxx@lists.osr.com] On Behalf Of Robin
Sent: Tuesday, February 19, 2002 4:00 AM
To: File Systems Developers
Subject: [ntfsd] How check if there is dirty data in the cache after
IRP_MJ_CLEANUPHello all,
I am monitoring file modifications (specially IRP_MJ_WRITE) from a
filter
driver and need to do something when all handles to a monitored file
are
closed and there is no more dirty data in the cache for this file. The
problem is how can I determine if there is still dirty data in the
cache
for this file and when the last dirty page for this file is flushed
out to
the disk using a paging IO through IRP_MJ_WRITE? I want to check this
in
the completion routine of both IRP_MJ_CLEANUP and IRP_MJ_WRITE (for
paging
IO only).Is there something like “CcIsThereDirtyData” for the FileObject? I
have
tried “CcGetLsnForFileObject”, but it is always returning zero.Any idea on how to solve this problem (on NT/2K/XP) will be highly
appreciated. Thanks in advance.Regards,
Robin
You are currently subscribed to ntfsd as: xxxxx@secretseal.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com