- Prepared ntfs for using CcInitializeCacheMap/CcUninitializeCacheMap
instead of CcRosInitializeFileCache/CcRosReleaseFileCache.
Modified: trunk/reactos/drivers/fs/ntfs/fcb.c
Modified: trunk/reactos/drivers/fs/ntfs/fsctl.c
Modified: trunk/reactos/drivers/fs/ntfs/ntfs.h
_____
Modified: trunk/reactos/drivers/fs/ntfs/fcb.c
--- trunk/reactos/drivers/fs/ntfs/fcb.c 2005-02-13 17:21:16 UTC (rev
13529)
+++ trunk/reactos/drivers/fs/ntfs/fcb.c 2005-02-13 17:23:41 UTC (rev
13530)
@@ -155,7 +155,11 @@
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);
@@ -241,7 +245,7 @@
newCCB->PtrFileObject = FileObject;
Fcb->FileObject = FileObject;
Fcb->DevExt = Vcb;
-
+#ifdef ROS_USE_CC_AND_FS
Status = CcRosInitializeFileCache(FileObject,
CACHEPAGESIZE(Vcb));
if (!NT_SUCCESS(Status))
@@ -249,7 +253,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;
@@ -394,7 +404,6 @@
PFCB Fcb,
PFILE_OBJECT FileObject)
{
- NTSTATUS Status;
PCCB newCCB;
newCCB = ExAllocatePoolWithTag(NonPagedPool, sizeof(CCB), TAG_CCB);
@@ -412,6 +421,8 @@
if (!(Fcb->Flags & FCB_CACHE_INITIALIZED))
{
+#ifdef ROS_USE_CC_AND_FS
+ NTSTATUS Status;
Status = CcRosInitializeFileCache(FileObject,
CACHEPAGESIZE(Vcb));
if (!NT_SUCCESS(Status))
@@ -419,6 +430,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/ntfs/fsctl.c
--- trunk/reactos/drivers/fs/ntfs/fsctl.c 2005-02-13 17:21:16 UTC
(rev 13529)
+++ trunk/reactos/drivers/fs/ntfs/fsctl.c 2005-02-13 17:23:41 UTC
(rev 13530)
@@ -387,7 +387,7 @@
// 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))
@@ -395,7 +395,13 @@
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);
_____
Modified: trunk/reactos/drivers/fs/ntfs/ntfs.h
--- trunk/reactos/drivers/fs/ntfs/ntfs.h 2005-02-13 17:21:16 UTC
(rev 13529)
+++ trunk/reactos/drivers/fs/ntfs/ntfs.h 2005-02-13 17:23:41 UTC
(rev 13530)
@@ -3,7 +3,9 @@
#include <ddk/ntifs.h>
+#define USE_ROS_CC_AND_FS
+
#define CACHEPAGESIZE(pDeviceExt) \
((pDeviceExt)->NtfsInfo.BytesPerCluster > PAGE_SIZE ? \
(pDeviceExt)->NtfsInfo.BytesPerCluster : PAGE_SIZE)
Show replies by date