Author: cwittich
Date: Sun Sep 4 06:20:53 2016
New Revision: 72558
URL: http://svn.reactos.org/svn/reactos?rev=72558&view=rev
Log:
[NTOS] addenum to r72556
Modified:
trunk/reactos/ntoskrnl/io/iomgr/iofunc.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/iofunc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iofunc.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] Sun Sep 4 06:20:53 2016
@@ -384,7 +384,7 @@
_SEH2_END;
}
- /* If we are dismounting a volume, increaase the dismount count */
+ /* If we are dismounting a volume, increase the dismount count */
if (IoControlCode == FSCTL_DISMOUNT_VOLUME)
{
InterlockedIncrement((PLONG)&SharedUserData->DismountCount);
Author: dchapyshev
Date: Sat Sep 3 21:25:45 2016
New Revision: 72554
URL: http://svn.reactos.org/svn/reactos?rev=72554&view=rev
Log:
[NTOS:IO]
- Implement Lookaside Floats allocations in IoAllocateIrp and IoFreeIrp
* Fixes 2 tests in kmtest:IoIrp
Modified:
trunk/reactos/ntoskrnl/io/iomgr/irp.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/irp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/irp.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] Sat Sep 3 21:25:45 2016
@@ -562,13 +562,14 @@
/* Set Charge Quota Flag */
if (ChargeQuota) Flags |= IRP_QUOTA_CHARGED;
- /* FIXME: Implement Lookaside Floats */
+ /* Get the PRCB */
+ Prcb = KeGetCurrentPrcb();
/* Figure out which Lookaside List to use */
- if ((StackSize <= 8) && (ChargeQuota == FALSE))
+ if ((StackSize <= 8) && (ChargeQuota == FALSE || Prcb->LookasideIrpFloat > 0))
{
/* Set Fixed Size Flag */
- Flags = IRP_ALLOCATED_FIXED_SIZE;
+ Flags |= IRP_ALLOCATED_FIXED_SIZE;
/* See if we should use big list */
if (StackSize != 1)
@@ -576,9 +577,6 @@
Size = IoSizeOfIrp(8);
ListType = LookasideLargeIrpList;
}
-
- /* Get the PRCB */
- Prcb = KeGetCurrentPrcb();
/* Get the P List First */
List = (PNPAGED_LOOKASIDE_LIST)Prcb->PPLookasideList[ListType].P;
@@ -622,8 +620,12 @@
/* Make sure it was sucessful */
if (!Irp) return NULL;
}
- else
- {
+ else if (Flags & IRP_QUOTA_CHARGED)
+ {
+ /* Decrement lookaside float */
+ InterlockedDecrement(&Prcb->LookasideIrpFloat);
+ Flags |= IRP_LOOKASIDE_ALLOCATION;
+
/* In this case there is no charge quota */
Flags &= ~IRP_QUOTA_CHARGED;
}
@@ -1587,7 +1589,7 @@
IoFreeIrp(IN PIRP Irp)
{
PNPAGED_LOOKASIDE_LIST List;
- PP_NPAGED_LOOKASIDE_NUMBER ListType = LookasideSmallIrpList;
+ PP_NPAGED_LOOKASIDE_NUMBER ListType = LookasideSmallIrpList;
PKPRCB Prcb;
IOTRACE(IO_IRP_DEBUG,
"%s - Freeing IRPs %p\n",
@@ -1599,6 +1601,16 @@
ASSERT(IsListEmpty(&Irp->ThreadListEntry));
ASSERT(Irp->CurrentLocation >= Irp->StackCount);
+ /* Get the PRCB */
+ Prcb = KeGetCurrentPrcb();
+
+ /* If this was a lookaside alloc, increment lookaside float */
+ if (Irp->AllocationFlags & IRP_LOOKASIDE_ALLOCATION)
+ {
+ Irp->AllocationFlags &= ~IRP_LOOKASIDE_ALLOCATION;
+ InterlockedIncrement(&Prcb->LookasideIrpFloat);
+ }
+
/* If this was a pool alloc, free it with the pool */
if (!(Irp->AllocationFlags & IRP_ALLOCATED_FIXED_SIZE))
{
@@ -1609,9 +1621,6 @@
{
/* Check if this was a Big IRP */
if (Irp->StackCount != 1) ListType = LookasideLargeIrpList;
-
- /* Get the PRCB */
- Prcb = KeGetCurrentPrcb();
/* Use the P List */
List = (PNPAGED_LOOKASIDE_LIST)Prcb->PPLookasideList[ListType].P;
@@ -1640,8 +1649,8 @@
/* The free was within the Depth */
if (Irp)
{
- InterlockedPushEntrySList(&List->L.ListHead,
- (PSLIST_ENTRY)Irp);
+ InterlockedPushEntrySList(&List->L.ListHead,
+ (PSLIST_ENTRY)Irp);
}
}
}
Author: dchapyshev
Date: Sat Sep 3 19:10:09 2016
New Revision: 72552
URL: http://svn.reactos.org/svn/reactos?rev=72552&view=rev
Log:
[NTOS:IO]
- Add dismount checking (function should behave the same in the fastio and the slow case)
- Fix comment
Modified:
trunk/reactos/ntoskrnl/io/iomgr/iofunc.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/iofunc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iofunc.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] Sat Sep 3 19:10:09 2016
@@ -348,7 +348,7 @@
DeviceObject = IoGetRelatedDeviceObject(FileObject);
}
- /* If that's FS I/O, try to do it with FastIO path */
+ /* If this is a device I/O, try to do it with FastIO path */
if (IsDevIoCtl)
{
PFAST_IO_DISPATCH FastIoDispatch = DeviceObject->DriverObject->FastIoDispatch;
@@ -613,6 +613,12 @@
/* Use deferred completion for FS I/O */
Irp->Flags |= (!IsDevIoCtl) ? IRP_DEFER_IO_COMPLETION : 0;
+
+ /* If we're to dismount a volume, increaase the dismount count */
+ if (IoControlCode == FSCTL_DISMOUNT_VOLUME)
+ {
+ InterlockedExchangeAdd((PLONG)&SharedUserData->DismountCount, 1);
+ }
/* Perform the call */
return IopPerformSynchronousRequest(DeviceObject,