Author: pschweitzer
Date: Sat Nov 1 07:25:07 2008
New Revision: 37129
URL:
http://svn.reactos.org/svn/reactos?rev=37129&view=rev
Log:
- Implemented FsRtlInitializeBaseMcb, FsRtlInitializeLargeMcb, FsRtlInitializeLargeMcbs
- FsRtlInitSystem now calls FsRtlInitializeLargeMcbs
- Moved INT_NOTIIFY_SYNC to fsrtl.h
Modified:
branches/pierre-fsd/ntoskrnl/fsrtl/fsrtlpc.c
branches/pierre-fsd/ntoskrnl/fsrtl/largemcb.c
branches/pierre-fsd/ntoskrnl/fsrtl/notify.c
branches/pierre-fsd/ntoskrnl/include/internal/fsrtl.h
Modified: branches/pierre-fsd/ntoskrnl/fsrtl/fsrtlpc.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/fsrtl/fsrtl…
==============================================================================
--- branches/pierre-fsd/ntoskrnl/fsrtl/fsrtlpc.c [iso-8859-1] (original)
+++ branches/pierre-fsd/ntoskrnl/fsrtl/fsrtlpc.c [iso-8859-1] Sat Nov 1 07:25:07 2008
@@ -168,6 +168,8 @@
IFS_POOL_TAG,
0);
+ FsRtlInitializeLargeMcbs();
+
/* Allocate the Resource Buffer */
FsRtlPagingIoResources = FsRtlAllocatePoolWithTag(NonPagedPool,
FSRTL_MAX_RESOURCES *
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] Sat Nov 1 07:25:07 2008
@@ -13,6 +13,11 @@
#define NDEBUG
#include <debug.h>
+/* GLOBALS *******************************************************************/
+
+PAGED_LOOKASIDE_LIST FsRtlFirstMappingLookasideList;
+PAGED_LOOKASIDE_LIST FsRtlFastMutexLookasideList;
+
/* PUBLIC FUNCTIONS **********************************************************/
/*
@@ -94,25 +99,66 @@
}
/*
- * @unimplemented
+ * @implemented
*/
VOID
NTAPI
FsRtlInitializeBaseMcb(IN PBASE_MCB Mcb,
IN POOL_TYPE PoolType)
{
- KEBUGCHECK(0);
-}
-
-/*
- * @unimplemented
+ Mcb->PairCount = 0;
+
+ if (PoolType == PagedPool)
+ {
+ Mcb->Mapping =
ExAllocateFromPagedLookasideList(&FsRtlFirstMappingLookasideList);
+ }
+ else
+ {
+ Mcb->Mapping = FsRtlAllocatePoolWithTag(PoolType, sizeof(INT_MAPPING) *
MAXIMUM_PAIR_COUNT, TAG('F', 'S', 'B', 'C'));
+ }
+
+ Mcb->PoolType = PoolType;
+ Mcb->MaximumPairCount = MAXIMUM_PAIR_COUNT;
+}
+
+/*
+ * @implemented
*/
VOID
NTAPI
FsRtlInitializeLargeMcb(IN PLARGE_MCB Mcb,
IN POOL_TYPE PoolType)
{
- KEBUGCHECK(0);
+ Mcb->FastMutex =
ExAllocateFromPagedLookasideList(&FsRtlFastMutexLookasideList);
+ ExInitializeFastMutex(Mcb->FastMutex);
+
+ FsRtlInitializeBaseMcb(&(Mcb->BaseMcb), PoolType);
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+FsRtlInitializeLargeMcbs(VOID)
+{
+ /* Initialize the list for the MCB */
+ ExInitializePagedLookasideList(&FsRtlFirstMappingLookasideList,
+ NULL,
+ NULL,
+ POOL_RAISE_IF_ALLOCATION_FAILURE,
+ sizeof(INT_MAPPING) * MAXIMUM_PAIR_COUNT,
+ IFS_POOL_TAG,
+ 0); /* FIXME: Should be 4 */
+
+ /* Initialize the list for the fast mutex */
+ ExInitializePagedLookasideList(&FsRtlFastMutexLookasideList,
+ NULL,
+ NULL,
+ POOL_RAISE_IF_ALLOCATION_FAILURE,
+ sizeof(FAST_MUTEX),
+ IFS_POOL_TAG,
+ 0); /* FIXME: Should be 32 */
}
/*
Modified: branches/pierre-fsd/ntoskrnl/fsrtl/notify.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/fsrtl/notif…
==============================================================================
--- branches/pierre-fsd/ntoskrnl/fsrtl/notify.c [iso-8859-1] (original)
+++ branches/pierre-fsd/ntoskrnl/fsrtl/notify.c [iso-8859-1] Sat Nov 1 07:25:07 2008
@@ -11,13 +11,6 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
-
-typedef struct _INT_NOTIFY_SYNC
-{
- FAST_MUTEX FastMutex;
- ULONG_PTR OwningThread;
- ULONG OwnerCount;
-} INT_NOTIFY_SYNC, * PINT_NOTIFY_SYNC;
/* PUBLIC FUNCTIONS **********************************************************/
Modified: branches/pierre-fsd/ntoskrnl/include/internal/fsrtl.h
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/include/int…
==============================================================================
--- branches/pierre-fsd/ntoskrnl/include/internal/fsrtl.h [iso-8859-1] (original)
+++ branches/pierre-fsd/ntoskrnl/include/internal/fsrtl.h [iso-8859-1] Sat Nov 1 07:25:07
2008
@@ -45,8 +45,38 @@
#define FSRTL_MAX_RESOURCES 16
//
+// Number of maximum pair count per MCB
+//
+#define MAXIMUM_PAIR_COUNT 15
+
+//
+// Internal structure for NOTIFY_SYNC
+//
+typedef struct _INT_NOTIFY_SYNC
+{
+ FAST_MUTEX FastMutex;
+ ULONG_PTR OwningThread;
+ ULONG OwnerCount;
+} INT_NOTIFY_SYNC, * PINT_NOTIFY_SYNC;
+
+//
+// Internal structure for MCB Mapping pointer
+//
+typedef struct _INT_MAPPING
+{
+ VBN Vbn;
+ LBN Lbn;
+} INT_MAPPING, *PINT_MAPPING;
+
+//
// Initialization Routines
//
+VOID
+NTAPI
+FsRtlInitializeLargeMcbs(
+ VOID
+);
+
BOOLEAN
NTAPI
FsRtlInitSystem(