mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
Changed initialization/deinitialization of caching.
svn path=/trunk/; revision=3479
This commit is contained in:
parent
b35e9d39b5
commit
b06d4dcc2f
2 changed files with 12 additions and 5 deletions
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: fcb.c,v 1.9 2002/09/08 10:22:09 chorns Exp $
|
||||
/* $Id: fcb.c,v 1.10 2002/09/09 17:26:24 hbirr Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -155,7 +155,6 @@ CdfsReleaseFCB(PDEVICE_EXTENSION Vcb,
|
|||
if (Fcb->RefCount <= 0 && !CdfsFCBIsDirectory(Fcb))
|
||||
{
|
||||
RemoveEntryList(&Fcb->FcbListEntry);
|
||||
CcRosReleaseFileCache(NULL, Fcb->RFCB.Bcb);
|
||||
CdfsDestroyFCB(Fcb);
|
||||
}
|
||||
KeReleaseSpinLock(&Vcb->FcbListLock, oldIrql);
|
||||
|
@ -386,7 +385,10 @@ CdfsMakeFCBFromDirEntry(PVCB Vcb,
|
|||
rcFCB->RFCB.FileSize.QuadPart = Size;
|
||||
rcFCB->RFCB.ValidDataLength.QuadPart = Size;
|
||||
rcFCB->RFCB.AllocationSize.QuadPart = ROUND_UP(Size, BLOCKSIZE);
|
||||
CdfsFCBInitializeCache(Vcb, rcFCB);
|
||||
if (CdfsFCBIsDirectory(rcFCB))
|
||||
{
|
||||
CdfsFCBInitializeCache(Vcb, rcFCB);
|
||||
}
|
||||
rcFCB->RefCount++;
|
||||
CdfsAddFCBToTable(Vcb, rcFCB);
|
||||
*fileFCB = rcFCB;
|
||||
|
@ -421,7 +423,7 @@ CdfsAttachFCBToFileObject(PDEVICE_EXTENSION Vcb,
|
|||
newCCB->PtrFileObject = FileObject;
|
||||
Fcb->DevExt = Vcb;
|
||||
|
||||
if (!(Fcb->Flags & FCB_CACHE_INITIALIZED))
|
||||
if (CdfsFCBIsDirectory(Fcb))
|
||||
{
|
||||
Status = CcRosInitializeFileCache(FileObject,
|
||||
&Fcb->RFCB.Bcb,
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: rw.c,v 1.4 2002/05/14 23:16:23 ekohl Exp $
|
||||
/* $Id: rw.c,v 1.5 2002/09/09 17:26:24 hbirr Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -86,6 +86,11 @@ CdfsReadFile(PDEVICE_EXTENSION DeviceExt,
|
|||
LARGE_INTEGER FileOffset;
|
||||
IO_STATUS_BLOCK IoStatus;
|
||||
|
||||
if (FileObject->PrivateCacheMap == NULL)
|
||||
{
|
||||
CcRosInitializeFileCache(FileObject, &Fcb->RFCB.Bcb, PAGESIZE);
|
||||
}
|
||||
|
||||
FileOffset.QuadPart = (LONGLONG)ReadOffset;
|
||||
CcCopyRead(FileObject,
|
||||
&FileOffset,
|
||||
|
|
Loading…
Reference in a new issue