Used lookasidelists for ibcb's.

Enabled caching of directories and fat segments.

svn path=/trunk/; revision=3969
This commit is contained in:
Hartmut Birr 2003-01-11 15:22:31 +00:00
parent a0e6246535
commit 7a00c6be46

View file

@ -1,4 +1,4 @@
/* $Id: pin.c,v 1.9 2002/12/15 17:01:52 chorns Exp $ /* $Id: pin.c,v 1.10 2003/01/11 15:22:31 hbirr Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -26,14 +26,9 @@
#define ROUND_DOWN(N, S) ((N) - ((N) % (S))) #define ROUND_DOWN(N, S) ((N) - ((N) % (S)))
/* FUNCTIONS *****************************************************************/ extern NPAGED_LOOKASIDE_LIST iBcbLookasideList;
typedef struct _INTERNAL_BCB /* FUNCTIONS *****************************************************************/
{
PUBLIC_BCB PFCB;
PCACHE_SEGMENT CacheSegment;
BOOLEAN Dirty;
} INTERNAL_BCB, *PINTERNAL_BCB;
BOOLEAN STDCALL BOOLEAN STDCALL
CcMapData (IN PFILE_OBJECT FileObject, CcMapData (IN PFILE_OBJECT FileObject,
@ -91,12 +86,13 @@ CcMapData (IN PFILE_OBJECT FileObject,
} }
} }
*pBuffer += ReadOffset % Bcb->CacheSegmentSize; *pBuffer += ReadOffset % Bcb->CacheSegmentSize;
iBcb = ExAllocatePool (NonPagedPool, sizeof(INTERNAL_BCB)); iBcb = ExAllocateFromNPagedLookasideList(&iBcbLookasideList);
if (iBcb == NULL) if (iBcb == NULL)
{ {
CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, FALSE, FALSE); CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, FALSE, FALSE);
return FALSE; return FALSE;
} }
memset(iBcb, 0, sizeof(INTERNAL_BCB));
iBcb->CacheSegment = CacheSeg; iBcb->CacheSegment = CacheSeg;
iBcb->Dirty = FALSE; iBcb->Dirty = FALSE;
iBcb->PFCB.MappedLength = Length; iBcb->PFCB.MappedLength = Length;
@ -111,7 +107,7 @@ CcUnpinData (IN PVOID Bcb)
PINTERNAL_BCB iBcb = Bcb; PINTERNAL_BCB iBcb = Bcb;
CcRosReleaseCacheSegment(iBcb->CacheSegment->Bcb, iBcb->CacheSegment, TRUE, CcRosReleaseCacheSegment(iBcb->CacheSegment->Bcb, iBcb->CacheSegment, TRUE,
iBcb->Dirty, FALSE); iBcb->Dirty, FALSE);
ExFreePool(iBcb); ExFreeToNPagedLookasideList(&iBcbLookasideList, iBcb);
} }
VOID STDCALL VOID STDCALL
@ -119,10 +115,6 @@ CcSetDirtyPinnedData (IN PVOID Bcb,
IN PLARGE_INTEGER Lsn) IN PLARGE_INTEGER Lsn)
{ {
PINTERNAL_BCB iBcb = Bcb; PINTERNAL_BCB iBcb = Bcb;
#if 0
iBcb->Dirty = TRUE; iBcb->Dirty = TRUE;
#else
WriteCacheSegment(iBcb->CacheSegment);
#endif
} }