Author: pschweitzer
Date: Sun Dec 28 16:24:52 2008
New Revision: 38436
URL:
http://svn.reactos.org/svn/reactos?rev=38436&view=rev
Log:
- Revert r35254.
- Fixed all MCB stuff according to that revert
Real thank to Alex for his help
Modified:
branches/pierre-fsd/include/ddk/ntifs.h
branches/pierre-fsd/ntoskrnl/fsrtl/largemcb.c
Modified: branches/pierre-fsd/include/ddk/ntifs.h
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/include/ddk/ntifs.h?…
==============================================================================
--- branches/pierre-fsd/include/ddk/ntifs.h [iso-8859-1] (original)
+++ branches/pierre-fsd/include/ddk/ntifs.h [iso-8859-1] Sun Dec 28 16:24:52 2008
@@ -1372,7 +1372,7 @@
typedef struct _LARGE_MCB
{
- PFAST_MUTEX FastMutex;
+ PKGUARDED_MUTEX GuardedMutex;
BASE_MCB BaseMcb;
} LARGE_MCB, *PLARGE_MCB;
Modified: branches/pierre-fsd/ntoskrnl/fsrtl/largemcb.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/fsrtl/large…
==============================================================================
--- branches/pierre-fsd/ntoskrnl/fsrtl/largemcb.c [iso-8859-1] (original)
+++ branches/pierre-fsd/ntoskrnl/fsrtl/largemcb.c [iso-8859-1] Sun Dec 28 16:24:52 2008
@@ -46,12 +46,12 @@
{
BOOLEAN Result;
- ExAcquireFastMutex(Mcb->FastMutex);
+ KeAcquireGuardedMutex(Mcb->GuardedMutex);
Result = FsRtlAddBaseMcbEntry(&(Mcb->BaseMcb),
Vbn,
Lbn,
SectorCount);
- ExReleaseFastMutex(Mcb->FastMutex);
+ KeReleaseGuardedMutex(Mcb->GuardedMutex);
return Result;
}
@@ -87,13 +87,13 @@
{
BOOLEAN Result;
- ExAcquireFastMutex(Mcb->FastMutex);
+ KeAcquireGuardedMutex(Mcb->GuardedMutex);
Result = FsRtlGetNextBaseMcbEntry(&(Mcb->BaseMcb),
RunIndex,
Vbn,
Lbn,
SectorCount);
- ExReleaseFastMutex(Mcb->FastMutex);
+ KeReleaseGuardedMutex(Mcb->GuardedMutex);
return Result;
}
@@ -129,10 +129,9 @@
FsRtlInitializeLargeMcb(IN PLARGE_MCB Mcb,
IN POOL_TYPE PoolType)
{
- Mcb->FastMutex =
ExAllocateFromNPagedLookasideList(&FsRtlFastMutexLookasideList);
-
- ExInitializeFastMutex(Mcb->FastMutex);
- KeInitializeGate((PKGATE)&(Mcb->FastMutex->Gate));
+ Mcb->GuardedMutex =
ExAllocateFromNPagedLookasideList(&FsRtlFastMutexLookasideList);
+
+ KeInitializeGuardedMutex(Mcb->GuardedMutex);
_SEH_TRY
{
@@ -141,8 +140,8 @@
_SEH_HANDLE
{
ExFreeToNPagedLookasideList(&FsRtlFastMutexLookasideList,
- Mcb->FastMutex);
- Mcb->FastMutex = NULL;
+ Mcb->GuardedMutex);
+ Mcb->GuardedMutex = NULL;
}
_SEH_END;
}
@@ -163,12 +162,12 @@
IFS_POOL_TAG,
0); /* FIXME: Should be 4 */
- /* Initialize the list for the fast mutex */
+ /* Initialize the list for the guarded mutex */
ExInitializeNPagedLookasideList(&FsRtlFastMutexLookasideList,
NULL,
NULL,
POOL_RAISE_IF_ALLOCATION_FAILURE,
- sizeof(FAST_MUTEX),
+ sizeof(KGUARDED_MUTEX),
IFS_POOL_TAG,
0); /* FIXME: Should be 32 */
}
@@ -207,7 +206,7 @@
{
BOOLEAN Result;
- ExAcquireFastMutex(Mcb->FastMutex);
+ KeAcquireGuardedMutex(Mcb->GuardedMutex);
Result = FsRtlLookupBaseMcbEntry(&(Mcb->BaseMcb),
Vbn,
Lbn,
@@ -215,7 +214,7 @@
StartingLbn,
SectorCountFromStartingLbn,
Index);
- ExReleaseFastMutex(Mcb->FastMutex);
+ KeReleaseGuardedMutex(Mcb->GuardedMutex);
return Result;
}
@@ -249,12 +248,12 @@
{
BOOLEAN Result;
- ExAcquireFastMutex(OpaqueMcb->FastMutex);
+ KeAcquireGuardedMutex(OpaqueMcb->GuardedMutex);
Result = FsRtlLookupLastBaseMcbEntryAndIndex(&(OpaqueMcb->BaseMcb),
LargeVbn,
LargeLbn,
Index);
- ExReleaseFastMutex(OpaqueMcb->FastMutex);
+ KeReleaseGuardedMutex(OpaqueMcb->GuardedMutex);
return Result;
}
@@ -283,11 +282,11 @@
{
BOOLEAN Result;
- ExAcquireFastMutex(Mcb->FastMutex);
+ KeAcquireGuardedMutex(Mcb->GuardedMutex);
Result = FsRtlLookupLastBaseMcbEntry(&(Mcb->BaseMcb),
Vbn,
Lbn);
- ExReleaseFastMutex(Mcb->FastMutex);
+ KeReleaseGuardedMutex(Mcb->GuardedMutex);
return Result;
}
@@ -313,9 +312,9 @@
ULONG NumberOfRuns;
/* Read the number of runs while holding the MCB lock */
- ExAcquireFastMutex(Mcb->FastMutex);
+ KeAcquireGuardedMutex(Mcb->GuardedMutex);
NumberOfRuns = Mcb->BaseMcb.PairCount;
- ExReleaseFastMutex(Mcb->FastMutex);
+ KeReleaseGuardedMutex(Mcb->GuardedMutex);
/* Return the count */
return NumberOfRuns;
@@ -343,11 +342,11 @@
IN LONGLONG Vbn,
IN LONGLONG SectorCount)
{
- ExAcquireFastMutex(Mcb->FastMutex);
+ KeAcquireGuardedMutex(Mcb->GuardedMutex);
FsRtlRemoveBaseMcbEntry(&(Mcb->BaseMcb),
Vbn,
SectorCount);
- ExReleaseFastMutex(Mcb->FastMutex);
+ KeReleaseGuardedMutex(Mcb->GuardedMutex);
}
/*
@@ -370,9 +369,9 @@
{
if (!SelfSynchronized)
{
- ExAcquireFastMutex(Mcb->FastMutex);
+ KeAcquireGuardedMutex(Mcb->GuardedMutex);
Mcb->BaseMcb.PairCount = 0;
- ExReleaseFastMutex(Mcb->FastMutex);
+ KeReleaseGuardedMutex(Mcb->GuardedMutex);
}
else
{
@@ -404,11 +403,11 @@
{
BOOLEAN Result;
- ExAcquireFastMutex(Mcb->FastMutex);
+ KeAcquireGuardedMutex(Mcb->GuardedMutex);
Result = FsRtlSplitBaseMcb(&(Mcb->BaseMcb),
Vbn,
Amount);
- ExReleaseFastMutex(Mcb->FastMutex);
+ KeReleaseGuardedMutex(Mcb->GuardedMutex);
return Result;
}
@@ -432,10 +431,10 @@
FsRtlTruncateLargeMcb(IN PLARGE_MCB Mcb,
IN LONGLONG Vbn)
{
- ExAcquireFastMutex(Mcb->FastMutex);
+ KeAcquireGuardedMutex(Mcb->GuardedMutex);
FsRtlTruncateBaseMcb(&(Mcb->BaseMcb),
Vbn);
- ExReleaseFastMutex(Mcb->FastMutex);
+ KeReleaseGuardedMutex(Mcb->GuardedMutex);
}
/*
@@ -463,10 +462,10 @@
NTAPI
FsRtlUninitializeLargeMcb(IN PLARGE_MCB Mcb)
{
- if (Mcb->FastMutex)
+ if (Mcb->GuardedMutex)
{
ExFreeToNPagedLookasideList(&FsRtlFastMutexLookasideList,
- Mcb->FastMutex);
+ Mcb->GuardedMutex);
FsRtlUninitializeBaseMcb(&(Mcb->BaseMcb));
}
}