mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-08 04:52:10 -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);
|
FspFileNodeAcquireExclusive(FileNode, Full);
|
||||||
|
|
||||||
PFILE_OBJECT CcFileObject =
|
if (0 != FileNode->NonPaged->SectionObjectPointers.DataSectionObject)
|
||||||
CcGetFileObjectFromSectionPtrsRef(&FileNode->NonPaged->SectionObjectPointers);
|
|
||||||
if (0 != CcFileObject)
|
|
||||||
{
|
{
|
||||||
IO_STATUS_BLOCK IoStatus;
|
IO_STATUS_BLOCK IoStatus;
|
||||||
CACHE_UNINITIALIZE_EVENT UninitializeEvent;
|
FspCcFlushCache(&FileNode->NonPaged->SectionObjectPointers, 0, 0, &IoStatus);
|
||||||
|
if (NT_SUCCESS(IoStatus.Status))
|
||||||
FspCcFlushCache(CcFileObject->SectionObjectPointer, 0, 0, &IoStatus);
|
CcPurgeCacheSection(&FileNode->NonPaged->SectionObjectPointers, 0, 0, FALSE);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FspFileNodeInvalidateFileInfo(FileNode);
|
FspFileNodeInvalidateFileInfo(FileNode);
|
||||||
@ -2362,6 +2349,7 @@ VOID FspFileNodeInvalidateCachesAndNotifyChangeByName(PDEVICE_OBJECT FsvolDevice
|
|||||||
FspFileNodeNotifyChange(FileNode, Filter, Action, InvalidateParentCaches);
|
FspFileNodeNotifyChange(FileNode, Filter, Action, InvalidateParentCaches);
|
||||||
|
|
||||||
FspFileNodeRelease(FileNode, Full);
|
FspFileNodeRelease(FileNode, Full);
|
||||||
|
|
||||||
FspFileNodeDereference(FileNode);
|
FspFileNodeDereference(FileNode);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -453,6 +453,6 @@ void notify_tests(void)
|
|||||||
TEST(notify_abandon_rename_test);
|
TEST(notify_abandon_rename_test);
|
||||||
TEST(notify_timeout_test);
|
TEST(notify_timeout_test);
|
||||||
TEST(notify_change_test);
|
TEST(notify_change_test);
|
||||||
//TEST(notify_open_change_test);
|
TEST(notify_open_change_test);
|
||||||
TEST(notify_dirnotify_test);
|
//TEST(notify_dirnotify_test);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user