- Prepared cdfs for using CcInitializeCacheMap/CcUninitializeCacheMap
instead of CcRosInitializeFileCache/CcRosReleaseFileCache.
Modified: trunk/reactos/drivers/fs/cdfs/cdfs.h
Modified: trunk/reactos/drivers/fs/cdfs/cleanup.c
Modified: trunk/reactos/drivers/fs/cdfs/fcb.c
Modified: trunk/reactos/drivers/fs/cdfs/fsctl.c
_____
Modified: trunk/reactos/drivers/fs/cdfs/cdfs.h
--- trunk/reactos/drivers/fs/cdfs/cdfs.h 2005-02-13 17:10:59 UTC
(rev 13528)
+++ trunk/reactos/drivers/fs/cdfs/cdfs.h 2005-02-13 17:21:16 UTC
(rev 13529)
@@ -3,6 +3,8 @@
#include <ddk/ntifs.h>
+#define USE_ROS_CC_AND_FS
+
#define CDFS_BASIC_SECTOR 2048
#define CDFS_PRIMARY_DESCRIPTOR_LOCATION 16
#define BLOCKSIZE CDFS_BASIC_SECTOR
_____
Modified: trunk/reactos/drivers/fs/cdfs/cleanup.c
--- trunk/reactos/drivers/fs/cdfs/cleanup.c 2005-02-13 17:10:59 UTC
(rev 13528)
+++ trunk/reactos/drivers/fs/cdfs/cleanup.c 2005-02-13 17:21:16 UTC
(rev 13529)
@@ -54,7 +54,11 @@
/* Uninitialize file cache if initialized for this file object. */
if (FileObject->SectionObjectPointer &&
FileObject->SectionObjectPointer->SharedCacheMap)
{
+#ifdef USE_ROS_CC_AND_FS
CcRosReleaseFileCache (FileObject);
+#else
+ CcUninitializeCacheMap (FileObject, NULL, NULL);
+#endif
}
return STATUS_SUCCESS;
_____
Modified: trunk/reactos/drivers/fs/cdfs/fcb.c
--- trunk/reactos/drivers/fs/cdfs/fcb.c 2005-02-13 17:10:59 UTC (rev
13528)
+++ trunk/reactos/drivers/fs/cdfs/fcb.c 2005-02-13 17:21:16 UTC (rev
13529)
@@ -241,6 +241,7 @@
Fcb->FileObject = FileObject;
Fcb->DevExt = Vcb;
+#ifdef USE_ROS_AND_FS
Status = CcRosInitializeFileCache(FileObject,
PAGE_SIZE);
if (!NT_SUCCESS(Status))
@@ -248,6 +249,13 @@
DbgPrint("CcRosInitializeFileCache failed\n");
KEBUGCHECK(0);
}
+#else
+ CcInitializeCacheMap(FileObject,
+ (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
+ FALSE,
+ NULL,
+ NULL);
+#endif
ObDereferenceObject(FileObject);
Fcb->Flags |= FCB_CACHE_INITIALIZED;
@@ -411,7 +419,6 @@
PFCB Fcb,
PFILE_OBJECT FileObject)
{
- NTSTATUS Status;
PCCB newCCB;
newCCB = ExAllocatePoolWithTag(NonPagedPool, sizeof(CCB), TAG_CCB);
@@ -426,9 +433,11 @@
FileObject->FsContext2 = newCCB;
newCCB->PtrFileObject = FileObject;
Fcb->DevExt = Vcb;
-
+
if (CdfsFCBIsDirectory(Fcb))
{
+#ifdef USE_ROS_CC_AND_FS
+ NTSTATUS Status;
Status = CcRosInitializeFileCache(FileObject,
PAGE_SIZE);
if (!NT_SUCCESS(Status))
@@ -436,6 +445,13 @@
DbgPrint("CcRosInitializeFileCache failed\n");
KEBUGCHECK(0);
}
+#else
+ CcInitializeCacheMap(FileObject,
+ (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
+ FALSE,
+ NULL,
+ NULL);
+#endif
Fcb->Flags |= FCB_CACHE_INITIALIZED;
}
_____
Modified: trunk/reactos/drivers/fs/cdfs/fsctl.c
--- trunk/reactos/drivers/fs/cdfs/fsctl.c 2005-02-13 17:10:59 UTC
(rev 13528)
+++ trunk/reactos/drivers/fs/cdfs/fsctl.c 2005-02-13 17:21:16 UTC
(rev 13529)
@@ -402,7 +402,7 @@
Fcb->Entry.ExtentLocationL = 0;
Fcb->Entry.DataLengthL = (DeviceExt->CdInfo.VolumeSpaceSize +
DeviceExt->CdInfo.VolumeOffset) * BLOCKSIZE;
-
+#ifdef USE_ROS_CC_AND_FS
Status = CcRosInitializeFileCache(DeviceExt->StreamFileObject,
PAGE_SIZE);
if (!NT_SUCCESS (Status))
@@ -410,7 +410,13 @@
DbgPrint("CcRosInitializeFileCache failed\n");
goto ByeBye;
}
-
+#else
+ CcInitializeCacheMap(DeviceExt->StreamFileObject,
+ (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
+ TRUE,
+ NULL,
+ NULL);
+#endif
ExInitializeResourceLite(&DeviceExt->VcbResource);
ExInitializeResourceLite(&DeviceExt->DirResource);
Show replies by date