mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
sys: FspFileNodeInvalidateCachesAndNotifyChangeByName: flush and purge only
This commit is contained in:
parent
10c8c440f9
commit
e59a49992a
@ -2332,25 +2332,12 @@ VOID FspFileNodeInvalidateCachesAndNotifyChangeByName(PDEVICE_OBJECT FsvolDevice
|
||||
{
|
||||
FspFileNodeAcquireExclusive(FileNode, Full);
|
||||
|
||||
PFILE_OBJECT CcFileObject =
|
||||
CcGetFileObjectFromSectionPtrsRef(&FileNode->NonPaged->SectionObjectPointers);
|
||||
if (0 != CcFileObject)
|
||||
if (0 != FileNode->NonPaged->SectionObjectPointers.DataSectionObject)
|
||||
{
|
||||
IO_STATUS_BLOCK IoStatus;
|
||||
CACHE_UNINITIALIZE_EVENT UninitializeEvent;
|
||||
|
||||
FspCcFlushCache(CcFileObject->SectionObjectPointer, 0, 0, &IoStatus);
|
||||
CcPurgeCacheSection(CcFileObject->SectionObjectPointer, 0, 0, TRUE);
|
||||
if (0 != CcFileObject->SectionObjectPointer->SharedCacheMap)
|
||||
{
|
||||
UninitializeEvent.Next = 0;
|
||||
KeInitializeEvent(&UninitializeEvent.Event, NotificationEvent, FALSE);
|
||||
BOOLEAN CacheStopped = CcUninitializeCacheMap(CcFileObject, 0, &UninitializeEvent);
|
||||
(VOID)CacheStopped; ASSERT(CacheStopped);
|
||||
KeWaitForSingleObject(&UninitializeEvent.Event, Executive, KernelMode, FALSE, 0);
|
||||
}
|
||||
|
||||
ObDereferenceObject(CcFileObject);
|
||||
FspCcFlushCache(&FileNode->NonPaged->SectionObjectPointers, 0, 0, &IoStatus);
|
||||
if (NT_SUCCESS(IoStatus.Status))
|
||||
CcPurgeCacheSection(&FileNode->NonPaged->SectionObjectPointers, 0, 0, FALSE);
|
||||
}
|
||||
|
||||
FspFileNodeInvalidateFileInfo(FileNode);
|
||||
@ -2362,6 +2349,7 @@ VOID FspFileNodeInvalidateCachesAndNotifyChangeByName(PDEVICE_OBJECT FsvolDevice
|
||||
FspFileNodeNotifyChange(FileNode, Filter, Action, InvalidateParentCaches);
|
||||
|
||||
FspFileNodeRelease(FileNode, Full);
|
||||
|
||||
FspFileNodeDereference(FileNode);
|
||||
}
|
||||
else
|
||||
|
@ -453,6 +453,6 @@ void notify_tests(void)
|
||||
TEST(notify_abandon_rename_test);
|
||||
TEST(notify_timeout_test);
|
||||
TEST(notify_change_test);
|
||||
//TEST(notify_open_change_test);
|
||||
TEST(notify_dirnotify_test);
|
||||
TEST(notify_open_change_test);
|
||||
//TEST(notify_dirnotify_test);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user