Use non-paged lookaside list for IRP context allocation

svn path=/trunk/; revision=67883
This commit is contained in:
Pierre Schweitzer 2015-05-24 15:26:15 +00:00
parent 6c9074c225
commit 4c9b6600ea
4 changed files with 7 additions and 4 deletions

View file

@ -117,7 +117,7 @@ NtfsDispatch(PNTFS_IRP_CONTEXT IrpContext)
} }
else else
{ {
ExFreePoolWithTag(IrpContext, 'PRIN'); ExFreeToNPagedLookasideList(&NtfsGlobalData->IrpContextLookasideList, IrpContext);
} }
IoSetTopLevelIrp(NULL); IoSetTopLevelIrp(NULL);

View file

@ -70,9 +70,7 @@ NtfsAllocateIrpContext(PDEVICE_OBJECT DeviceObject,
TRACE_(NTFS, "NtfsAllocateIrpContext()\n"); TRACE_(NTFS, "NtfsAllocateIrpContext()\n");
IrpContext = (PNTFS_IRP_CONTEXT)ExAllocatePoolWithTag(NonPagedPool, IrpContext = (PNTFS_IRP_CONTEXT)ExAllocateFromNPagedLookasideList(&NtfsGlobalData->IrpContextLookasideList);
sizeof(NTFS_IRP_CONTEXT),
'PRIN');
if (IrpContext == NULL) if (IrpContext == NULL)
return NULL; return NULL;

View file

@ -96,6 +96,10 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
NtfsGlobalData->FastIoDispatch.FastIoWrite = NtfsFastIoWrite; NtfsGlobalData->FastIoDispatch.FastIoWrite = NtfsFastIoWrite;
DriverObject->FastIoDispatch = &NtfsGlobalData->FastIoDispatch; DriverObject->FastIoDispatch = &NtfsGlobalData->FastIoDispatch;
/* Initialize lookaside list for IRP contexts */
ExInitializeNPagedLookasideList(&NtfsGlobalData->IrpContextLookasideList,
NULL, NULL, 0, sizeof(NTFS_IRP_CONTEXT), 'PRIN', 0);
/* Driver can't be unloaded */ /* Driver can't be unloaded */
DriverObject->DriverUnload = NULL; DriverObject->DriverUnload = NULL;

View file

@ -137,6 +137,7 @@ typedef struct
CACHE_MANAGER_CALLBACKS CacheMgrCallbacks; CACHE_MANAGER_CALLBACKS CacheMgrCallbacks;
ULONG Flags; ULONG Flags;
FAST_IO_DISPATCH FastIoDispatch; FAST_IO_DISPATCH FastIoDispatch;
NPAGED_LOOKASIDE_LIST IrpContextLookasideList;
} NTFS_GLOBAL_DATA, *PNTFS_GLOBAL_DATA; } NTFS_GLOBAL_DATA, *PNTFS_GLOBAL_DATA;