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

View file

@ -400,21 +400,13 @@ NtfsMountVolume(PDEVICE_OBJECT DeviceObject,
// Fcb->Entry.ExtentLocationL = 0; // Fcb->Entry.ExtentLocationL = 0;
// Fcb->Entry.DataLengthL = DeviceExt->CdInfo.VolumeSpaceSize * BLOCKSIZE; // 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, CcInitializeCacheMap(DeviceExt->StreamFileObject,
(PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize), (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
FALSE, FALSE,
NULL, NULL,
NULL); NULL);
#endif
ExInitializeResourceLite(&DeviceExt->DirResource); ExInitializeResourceLite(&DeviceExt->DirResource);
// ExInitializeResourceLite(&DeviceExt->FatResource); // ExInitializeResourceLite(&DeviceExt->FatResource);

View file

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