- Remove ros-specific Cc functions usage.

- TODO: Provide callbacks for lazy writer and read ahead when calling CcInitializeCacheMap. Could be done similar to r32607 for CDFS.

svn path=/trunk/; revision=32610
This commit is contained in:
Aleksey Bragin 2008-03-08 12:14:41 +00:00
parent 0b0d237b03
commit 9948ff11e8
3 changed files with 10 additions and 42 deletions

View file

@ -152,11 +152,7 @@ NtfsReleaseFCB(PDEVICE_EXTENSION Vcb,
if (Fcb->RefCount <= 0 && !NtfsFCBIsDirectory(Fcb))
{
RemoveEntryList(&Fcb->FcbListEntry);
#ifdef USE_ROS_CC_AND_FS
CcRosReleaseFileCache(Fcb->FileObject);
#else
CcUninitializeCacheMap (Fcb->FileObject, NULL, NULL);
#endif
NtfsDestroyFCB(Fcb);
}
KeReleaseSpinLock(&Vcb->FcbListLock, oldIrql);
@ -242,22 +238,14 @@ NtfsFCBInitializeCache(PVCB Vcb,
newCCB->PtrFileObject = FileObject;
Fcb->FileObject = FileObject;
Fcb->DevExt = Vcb;
#ifdef ROS_USE_CC_AND_FS
Status = CcRosInitializeFileCache(FileObject,
CACHEPAGESIZE(Vcb));
if (!NT_SUCCESS(Status))
{
DbgPrint("CcRosInitializeFileCache failed\n");
KEBUGCHECK(0);
}
#else
Status = STATUS_SUCCESS;
CcInitializeCacheMap(FileObject,
(PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
FALSE,
NULL,
NULL);
#endif
ObDereferenceObject(FileObject);
Fcb->Flags |= FCB_CACHE_INITIALIZED;
@ -419,22 +407,12 @@ NtfsAttachFCBToFileObject(PDEVICE_EXTENSION Vcb,
if (!(Fcb->Flags & FCB_CACHE_INITIALIZED))
{
#ifdef ROS_USE_CC_AND_FS
NTSTATUS Status;
Status = CcRosInitializeFileCache(FileObject,
CACHEPAGESIZE(Vcb));
if (!NT_SUCCESS(Status))
{
DbgPrint("CcRosInitializeFileCache failed\n");
KEBUGCHECK(0);
}
#else
CcInitializeCacheMap(FileObject,
(PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
FALSE,
NULL,
NULL);
#endif
CcInitializeCacheMap(FileObject,
(PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
FALSE,
NULL,
NULL);
Fcb->Flags |= FCB_CACHE_INITIALIZED;
}

View file

@ -400,21 +400,13 @@ NtfsMountVolume(PDEVICE_OBJECT DeviceObject,
// Fcb->Entry.ExtentLocationL = 0;
// Fcb->Entry.DataLengthL = DeviceExt->CdInfo.VolumeSpaceSize * BLOCKSIZE;
#ifdef ROS_USE_CC_AND_FS
Status = CcRosInitializeFileCache(DeviceExt->StreamFileObject,
CACHEPAGESIZE(DeviceExt));
if (!NT_SUCCESS (Status))
{
DbgPrint("CcRosInitializeFileCache() failed (Status %lx)\n", Status);
goto ByeBye;
}
#else
CcInitializeCacheMap(DeviceExt->StreamFileObject,
(PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
FALSE,
NULL,
NULL);
#endif
ExInitializeResourceLite(&DeviceExt->DirResource);
// ExInitializeResourceLite(&DeviceExt->FatResource);

View file

@ -6,8 +6,6 @@
#include <ntdddisk.h>
#include <ccros.h>
#define USE_ROS_CC_AND_FS
#define CACHEPAGESIZE(pDeviceExt) \
((pDeviceExt)->NtfsInfo.UCHARsPerCluster > PAGE_SIZE ? \
(pDeviceExt)->NtfsInfo.UCHARsPerCluster : PAGE_SIZE)