mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 07:53:07 +00:00
Release MDL on IRP-completion. Thanks to Hartmut Birr.
svn path=/trunk/; revision=2874
This commit is contained in:
parent
4e09f73d4d
commit
e2ccc04cc8
1 changed files with 13 additions and 7 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: class2.c,v 1.16 2002/04/24 22:20:50 ekohl Exp $
|
/* $Id: class2.c,v 1.17 2002/04/27 19:01:24 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -876,6 +876,15 @@ ScsiClassIoComplete(PDEVICE_OBJECT DeviceObject,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Free the IRP's MDL */
|
||||||
|
if (Irp->MdlAddress->MappedSystemVa != NULL)
|
||||||
|
{
|
||||||
|
MmUnmapLockedPages(Irp->MdlAddress->MappedSystemVa,
|
||||||
|
Irp->MdlAddress);
|
||||||
|
}
|
||||||
|
MmUnlockPages(Irp->MdlAddress);
|
||||||
|
ExFreePool(Irp->MdlAddress);
|
||||||
|
|
||||||
/* FIXME: use lookaside list instead */
|
/* FIXME: use lookaside list instead */
|
||||||
DPRINT("Freed SRB %p\n", IrpStack->Parameters.Scsi.Srb);
|
DPRINT("Freed SRB %p\n", IrpStack->Parameters.Scsi.Srb);
|
||||||
ExFreePool(IrpStack->Parameters.Scsi.Srb);
|
ExFreePool(IrpStack->Parameters.Scsi.Srb);
|
||||||
|
@ -1165,7 +1174,6 @@ ScsiClassSendSrbSynchronous(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp;
|
PIRP Irp;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
|
||||||
DPRINT("ScsiClassSendSrbSynchronous() called\n");
|
DPRINT("ScsiClassSendSrbSynchronous() called\n");
|
||||||
|
|
||||||
RetryCount = MAXIMUM_RETRIES;
|
RetryCount = MAXIMUM_RETRIES;
|
||||||
|
@ -1299,7 +1307,7 @@ ScsiClassSplitRequest(PDEVICE_OBJECT DeviceObject,
|
||||||
ULONG DataLength;
|
ULONG DataLength;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
DPRINT1("ScsiClassSplitRequest(DeviceObject %lx Irp %lx MaximumBytes %lu)\n",
|
DPRINT("ScsiClassSplitRequest(DeviceObject %lx Irp %lx MaximumBytes %lu)\n",
|
||||||
DeviceObject, Irp, MaximumBytes);
|
DeviceObject, Irp, MaximumBytes);
|
||||||
|
|
||||||
DeviceExtension = DeviceObject->DeviceExtension;
|
DeviceExtension = DeviceObject->DeviceExtension;
|
||||||
|
@ -1316,7 +1324,7 @@ ScsiClassSplitRequest(PDEVICE_OBJECT DeviceObject,
|
||||||
/* Save request count in the original IRP */
|
/* Save request count in the original IRP */
|
||||||
NextStack->Parameters.Others.Argument1 = (PVOID)RequestCount;
|
NextStack->Parameters.Others.Argument1 = (PVOID)RequestCount;
|
||||||
|
|
||||||
DPRINT1("RequestCount %lu\n", RequestCount);
|
DPRINT("RequestCount %lu\n", RequestCount);
|
||||||
|
|
||||||
for (i = 0; i < RequestCount; i++)
|
for (i = 0; i < RequestCount; i++)
|
||||||
{
|
{
|
||||||
|
@ -1479,8 +1487,6 @@ ScsiClassReadWrite(IN PDEVICE_OBJECT DeviceObject,
|
||||||
return(STATUS_PENDING);
|
return(STATUS_PENDING);
|
||||||
}
|
}
|
||||||
|
|
||||||
IoMarkIrpPending(Irp);
|
|
||||||
|
|
||||||
/* Adjust partition-relative starting offset to absolute offset */
|
/* Adjust partition-relative starting offset to absolute offset */
|
||||||
IrpStack->Parameters.Read.ByteOffset.QuadPart += DeviceExtension->StartingOffset.QuadPart;
|
IrpStack->Parameters.Read.ByteOffset.QuadPart += DeviceExtension->StartingOffset.QuadPart;
|
||||||
|
|
||||||
|
@ -1492,7 +1498,7 @@ ScsiClassReadWrite(IN PDEVICE_OBJECT DeviceObject,
|
||||||
if (CurrentTransferLength > MaximumTransferLength ||
|
if (CurrentTransferLength > MaximumTransferLength ||
|
||||||
CurrentTransferPages > MaximumTransferPages)
|
CurrentTransferPages > MaximumTransferPages)
|
||||||
{
|
{
|
||||||
DPRINT1("Split current request: MaximumTransferLength %lu CurrentTransferLength %lu\n",
|
DPRINT("Split current request: MaximumTransferLength %lu CurrentTransferLength %lu\n",
|
||||||
MaximumTransferLength, CurrentTransferLength);
|
MaximumTransferLength, CurrentTransferLength);
|
||||||
|
|
||||||
/* Adjust the maximum transfer length */
|
/* Adjust the maximum transfer length */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue