Author: arty Date: Wed Aug 27 10:21:39 2008 New Revision: 35701
URL: http://svn.reactos.org/svn/reactos?rev=35701&view=rev Log: Convert to using a fast mutex.
Modified: branches/arty-newcc/ntoskrnl/cache/cachesub.c branches/arty-newcc/ntoskrnl/cache/fssup.c branches/arty-newcc/ntoskrnl/cache/pinsup.c branches/arty-newcc/ntoskrnl/include/internal/cc.h
Modified: branches/arty-newcc/ntoskrnl/cache/cachesub.c URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/caches... ============================================================================== --- branches/arty-newcc/ntoskrnl/cache/cachesub.c [iso-8859-1] (original) +++ branches/arty-newcc/ntoskrnl/cache/cachesub.c [iso-8859-1] Wed Aug 27 10:21:39 2008 @@ -21,10 +21,6 @@ NTAPI MmGetDeviceObjectForFile(IN PFILE_OBJECT FileObject);
-BOOLEAN -NTAPI -MmIsCOWAddress(PEPROCESS Process, PVOID Address); - NTSTATUS NTAPI CcpSimpleWrite @@ -43,8 +39,7 @@
KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
- if (MmIsDirtyPage(PsInitialSystemProcess, Buffer) && - !MmIsCOWAddress(PsInitialSystemProcess, Buffer)) + if (MmIsDirtyPage(PsInitialSystemProcess, Buffer)) { DPRINT1 ("PAGING WRITE (FLUSH) Offset %x Length %d\n", @@ -100,7 +95,6 @@ } ObDereferenceObject(FileObject); - MmDeleteHyperspaceMapping(Buffer);
DPRINT("Paging IO Done: %08x\n", ReadStatus->Status); }
Modified: branches/arty-newcc/ntoskrnl/cache/fssup.c URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/fssup.... ============================================================================== --- branches/arty-newcc/ntoskrnl/cache/fssup.c [iso-8859-1] (original) +++ branches/arty-newcc/ntoskrnl/cache/fssup.c [iso-8859-1] Wed Aug 27 10:21:39 2008 @@ -44,7 +44,7 @@ CcCacheBitmap->Buffer = ((PULONG)&CcCacheBitmap[1]); CcCacheBitmap->SizeOfBitMap = ROUND_UP(CACHE_NUM_SECTIONS, 32); DPRINT("Cache has %d entries\n", CcCacheBitmap->SizeOfBitMap); - KeInitializeGuardedMutex(&CcMutex); + ExInitializeFastMutex(&CcMutex); Status = PsCreateSystemThread (&CcUnmapThreadHandle, THREAD_ALL_ACCESS,
Modified: branches/arty-newcc/ntoskrnl/cache/pinsup.c URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/pinsup... ============================================================================== --- branches/arty-newcc/ntoskrnl/cache/pinsup.c [iso-8859-1] (original) +++ branches/arty-newcc/ntoskrnl/cache/pinsup.c [iso-8859-1] Wed Aug 27 10:21:39 2008 @@ -22,7 +22,7 @@ NOCC_BCB CcCacheSections[CACHE_NUM_SECTIONS]; CHAR CcpBitmapBuffer[sizeof(RTL_BITMAP) + ROUND_UP((CACHE_NUM_SECTIONS), 32) / 8]; PRTL_BITMAP CcCacheBitmap = (PRTL_BITMAP)&CcpBitmapBuffer; -KGUARDED_MUTEX CcMutex; +FAST_MUTEX CcMutex; KEVENT CcDeleteEvent; ULONG CcCacheClockHand; LONG CcOutstandingDeletes; @@ -55,7 +55,7 @@
VOID CcpLock() { - KeAcquireGuardedMutex(&CcMutex); + ExAcquireFastMutex(&CcMutex); //DPRINT("<<<---<<< CC In Mutex!\n"); }
@@ -75,14 +75,14 @@ PCHAR BufStart, BufPage; LARGE_INTEGER ToWrite;
- KeAcquireGuardedMutex(&CcMutex); + ExAcquireFastMutex(&CcMutex); while (CcOutstandingDeletes > 0) { NumElements = InterlockedDecrement(&CcOutstandingDeletes); DPRINT1("Unmapping %d ...\n", NumElements); WorkingOn = CcUnmapChain[0]; RtlMoveMemory(&CcUnmapChain[0], &CcUnmapChain[1], NumElements * sizeof(NOCC_UNMAP_CHAIN)); - KeReleaseGuardedMutex(&CcMutex); + ExReleaseFastMutex(&CcMutex);
BufStart = (PCHAR)WorkingOn.Buffer; ToWrite = WorkingOn.FileOffset; @@ -98,15 +98,15 @@ MmUnmapViewInSystemSpace(WorkingOn.Buffer); ObDereferenceObject(WorkingOn.SectionObject); DPRINT1("Done unmapping\n"); - KeAcquireGuardedMutex(&CcMutex); - } - KeReleaseGuardedMutex(&CcMutex); + ExAcquireFastMutex(&CcMutex); + } + ExReleaseFastMutex(&CcMutex); }
VOID CcpUnlock() { //DPRINT(">>>--->>> CC Exit Mutex!\n"); - KeReleaseGuardedMutex(&CcMutex); + ExReleaseFastMutex(&CcMutex); }
VOID STDCALL
Modified: branches/arty-newcc/ntoskrnl/include/internal/cc.h URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/include/inte... ============================================================================== --- branches/arty-newcc/ntoskrnl/include/internal/cc.h [iso-8859-1] (original) +++ branches/arty-newcc/ntoskrnl/include/internal/cc.h [iso-8859-1] Wed Aug 27 10:21:39 2008 @@ -202,7 +202,7 @@
extern NOCC_BCB CcCacheSections[CACHE_NUM_SECTIONS]; extern PRTL_BITMAP CcCacheBitmap; -extern KGUARDED_MUTEX CcMutex; +extern FAST_MUTEX CcMutex; extern KEVENT CcDeleteEvent; extern ULONG CcCacheClockHand; extern LIST_ENTRY CcPendingUnmap;