mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTFS] Use LookasideList allocations for NTFS_ATTR_CONTEXT.
TODO: use a specific tag
This commit is contained in:
parent
849fa7fbae
commit
3ddf44ff10
3 changed files with 8 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue