Hervé Poussineau <poussine(a)freesurf.fr>
Use fast mutexes instead of spin locks because the file system callbacks
shouldn't be called at DISPATCH_LEVEL.
Modified: trunk/reactos/ntoskrnl/io/fs.c
_____
Modified: trunk/reactos/ntoskrnl/io/fs.c
--- trunk/reactos/ntoskrnl/io/fs.c 2005-01-28 21:04:12 UTC (rev
13356)
+++ trunk/reactos/ntoskrnl/io/fs.c 2005-01-28 21:17:11 UTC (rev
13357)
@@ -1,4 +1,4 @@
-/* $Id:$
+/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -35,7 +35,7 @@
static ERESOURCE FileSystemListLock;
static LIST_ENTRY FileSystemListHead;
-static KSPIN_LOCK FsChangeNotifyListLock;
+static FAST_MUTEX FsChangeNotifyListLock;
static LIST_ENTRY FsChangeNotifyListHead;
#define TAG_FILE_SYSTEM TAG('F', 'S', 'Y', 'S')
@@ -178,7 +178,7 @@
ExInitializeResourceLite(&FileSystemListLock);
InitializeListHead(&FsChangeNotifyListHead);
- KeInitializeSpinLock(&FsChangeNotifyListLock);
+ ExInitializeFastMutex(&FsChangeNotifyListLock);
}
@@ -709,9 +709,8 @@
{
PFS_CHANGE_NOTIFY_ENTRY ChangeEntry;
PLIST_ENTRY Entry;
- KIRQL oldlvl;
- KeAcquireSpinLock(&FsChangeNotifyListLock,&oldlvl);
+ ExAcquireFastMutex(&FsChangeNotifyListLock);
Entry = FsChangeNotifyListHead.Flink;
while (Entry != &FsChangeNotifyListHead)
{
@@ -721,7 +720,7 @@
Entry = Entry->Flink;
}
- KeReleaseSpinLock(&FsChangeNotifyListLock,oldlvl);
+ ExReleaseFastMutex(&FsChangeNotifyListLock);
}
@@ -743,9 +742,10 @@
Entry->DriverObject = DriverObject;
Entry->FSDNotificationProc = FSDNotificationProc;
- ExInterlockedInsertHeadList(&FsChangeNotifyListHead,
- &Entry->FsChangeNotifyList,
- &FsChangeNotifyListLock);
+ ExAcquireFastMutex(&FsChangeNotifyListLock);
+ InsertHeadList(&FsChangeNotifyListHead,
+ &Entry->FsChangeNotifyList);
+ ExReleaseFastMutex(&FsChangeNotifyListLock);
return(STATUS_SUCCESS);
}
@@ -760,7 +760,6 @@
{
PFS_CHANGE_NOTIFY_ENTRY ChangeEntry;
PLIST_ENTRY Entry;
- KIRQL oldlvl;
Entry = FsChangeNotifyListHead.Flink;
while (Entry != &FsChangeNotifyListHead)
@@ -769,9 +768,9 @@
if (ChangeEntry->DriverObject == DriverObject &&
ChangeEntry->FSDNotificationProc == FSDNotificationProc)
{
- KeAcquireSpinLock(&FsChangeNotifyListLock,&oldlvl);
+ ExAcquireFastMutex(&FsChangeNotifyListLock);
RemoveEntryList(Entry);
- KeReleaseSpinLock(&FsChangeNotifyListLock,oldlvl);
+ ExReleaseFastMutex(&FsChangeNotifyListLock);
ExFreePool(Entry);
return;