diff --git a/reactos/drivers/filesystems/ntfs/fcb.c b/reactos/drivers/filesystems/ntfs/fcb.c index 337aa97e03e..fe97f53b0a3 100644 --- a/reactos/drivers/filesystems/ntfs/fcb.c +++ b/reactos/drivers/filesystems/ntfs/fcb.c @@ -32,10 +32,6 @@ #define NDEBUG #include -/* MACROS *******************************************************************/ - -#define TAG_FCB 'BCFI' - /* FUNCTIONS ****************************************************************/ static @@ -76,7 +72,7 @@ NtfsCreateFCB(PCWSTR FileName, ASSERT(Vcb); ASSERT(Vcb->Identifier.Type == NTFS_TYPE_VCB); - Fcb = ExAllocatePoolWithTag(NonPagedPool, sizeof(NTFS_FCB), TAG_FCB); + Fcb = ExAllocateFromNPagedLookasideList(&NtfsGlobalData->FcbLookasideList); RtlZeroMemory(Fcb, sizeof(NTFS_FCB)); Fcb->Identifier.Type = NTFS_TYPE_FCB; @@ -113,7 +109,7 @@ NtfsDestroyFCB(PNTFS_FCB Fcb) ExDeleteResourceLite(&Fcb->MainResource); - ExFreePool(Fcb); + ExFreeToNPagedLookasideList(&NtfsGlobalData->FcbLookasideList, Fcb); } diff --git a/reactos/drivers/filesystems/ntfs/fsctl.c b/reactos/drivers/filesystems/ntfs/fsctl.c index 99f107eafb4..cd0845d7e7e 100644 --- a/reactos/drivers/filesystems/ntfs/fsctl.c +++ b/reactos/drivers/filesystems/ntfs/fsctl.c @@ -524,7 +524,7 @@ ByeBye: ObDereferenceObject(Vcb->StreamFileObject); if (Fcb) - ExFreePool(Fcb); + NtfsDestroyFCB(Fcb); if (Ccb) ExFreePool(Ccb); diff --git a/reactos/drivers/filesystems/ntfs/ntfs.c b/reactos/drivers/filesystems/ntfs/ntfs.c index 5599701cfa4..7646a5049d2 100644 --- a/reactos/drivers/filesystems/ntfs/ntfs.c +++ b/reactos/drivers/filesystems/ntfs/ntfs.c @@ -99,6 +99,9 @@ DriverEntry(PDRIVER_OBJECT DriverObject, /* Initialize lookaside list for IRP contexts */ ExInitializeNPagedLookasideList(&NtfsGlobalData->IrpContextLookasideList, NULL, NULL, 0, sizeof(NTFS_IRP_CONTEXT), 'PRIN', 0); + /* Initialize lookaside list for FCBs */ + ExInitializeNPagedLookasideList(&NtfsGlobalData->FcbLookasideList, + NULL, NULL, 0, sizeof(NTFS_FCB), TAG_FCB, 0); /* Driver can't be unloaded */ DriverObject->DriverUnload = NULL; diff --git a/reactos/drivers/filesystems/ntfs/ntfs.h b/reactos/drivers/filesystems/ntfs/ntfs.h index 1da9e07abf9..f7120916dd3 100644 --- a/reactos/drivers/filesystems/ntfs/ntfs.h +++ b/reactos/drivers/filesystems/ntfs/ntfs.h @@ -127,6 +127,7 @@ typedef struct } NTFS_CCB, *PNTFS_CCB; #define TAG_CCB 'BCCI' +#define TAG_FCB 'BCFI' typedef struct { @@ -138,6 +139,7 @@ typedef struct ULONG Flags; FAST_IO_DISPATCH FastIoDispatch; NPAGED_LOOKASIDE_LIST IrpContextLookasideList; + NPAGED_LOOKASIDE_LIST FcbLookasideList; } NTFS_GLOBAL_DATA, *PNTFS_GLOBAL_DATA;