diff --git a/drivers/filesystems/ntfs/mft.c b/drivers/filesystems/ntfs/mft.c index f623c72e68a..8594f79e56c 100644 --- a/drivers/filesystems/ntfs/mft.c +++ b/drivers/filesystems/ntfs/mft.c @@ -42,9 +42,7 @@ PrepareAttributeContext(PNTFS_ATTR_RECORD AttrRecord) { PNTFS_ATTR_CONTEXT Context; - Context = ExAllocatePoolWithTag(NonPagedPool, - sizeof(NTFS_ATTR_CONTEXT), - TAG_NTFS); + Context = ExAllocateFromNPagedLookasideList(&NtfsGlobalData->AttrCtxtLookasideList); if(!Context) { DPRINT1("Error: Unable to allocate memory for context!\n"); @@ -56,7 +54,7 @@ PrepareAttributeContext(PNTFS_ATTR_RECORD AttrRecord) if(!Context->pRecord) { DPRINT1("Error: Unable to allocate memory for attribute record!\n"); - ExFreePoolWithTag(Context, TAG_NTFS); + ExFreeToNPagedLookasideList(&NtfsGlobalData->AttrCtxtLookasideList, Context); return NULL; } @@ -93,7 +91,7 @@ PrepareAttributeContext(PNTFS_ATTR_RECORD AttrRecord) { DPRINT1("Unable to convert data runs to MCB!\n"); ExFreePoolWithTag(Context->pRecord, TAG_NTFS); - ExFreePoolWithTag(Context, TAG_NTFS); + ExFreeToNPagedLookasideList(&NtfsGlobalData->AttrCtxtLookasideList, Context); return NULL; } } @@ -115,7 +113,7 @@ ReleaseAttributeContext(PNTFS_ATTR_CONTEXT Context) ExFreePoolWithTag(Context->pRecord, TAG_NTFS); } - ExFreePoolWithTag(Context, TAG_NTFS); + ExFreeToNPagedLookasideList(&NtfsGlobalData->AttrCtxtLookasideList, Context); } diff --git a/drivers/filesystems/ntfs/ntfs.c b/drivers/filesystems/ntfs/ntfs.c index c9bbc490bda..53733e1dec3 100644 --- a/drivers/filesystems/ntfs/ntfs.c +++ b/drivers/filesystems/ntfs/ntfs.c @@ -146,6 +146,9 @@ DriverEntry(PDRIVER_OBJECT DriverObject, /* Initialize lookaside list for FCBs */ ExInitializeNPagedLookasideList(&NtfsGlobalData->FcbLookasideList, NULL, NULL, 0, sizeof(NTFS_FCB), TAG_FCB, 0); + /* Initialize lookaside list for attributes contexts */ + ExInitializeNPagedLookasideList(&NtfsGlobalData->AttrCtxtLookasideList, + NULL, NULL, 0, sizeof(NTFS_ATTR_CONTEXT), TAG_NTFS, 0); /* Driver can't be unloaded */ DriverObject->DriverUnload = NULL; diff --git a/drivers/filesystems/ntfs/ntfs.h b/drivers/filesystems/ntfs/ntfs.h index 97f4acd1d63..0b64b7247ed 100644 --- a/drivers/filesystems/ntfs/ntfs.h +++ b/drivers/filesystems/ntfs/ntfs.h @@ -152,6 +152,7 @@ typedef struct FAST_IO_DISPATCH FastIoDispatch; NPAGED_LOOKASIDE_LIST IrpContextLookasideList; NPAGED_LOOKASIDE_LIST FcbLookasideList; + NPAGED_LOOKASIDE_LIST AttrCtxtLookasideList; BOOLEAN EnableWriteSupport; } NTFS_GLOBAL_DATA, *PNTFS_GLOBAL_DATA;