From ac9d3e30fbff7230a95bc2f3784d480e043e8e22 Mon Sep 17 00:00:00 2001 From: Rex Jolliff Date: Fri, 4 May 2001 01:21:45 +0000 Subject: [PATCH] Changed Cc interface func names to CcRos. Changed CcReleaseFileCache to use and dereference FileObject in BCB instead of the one passed. svn path=/trunk/; revision=1880 --- reactos/drivers/fs/ext2/dir.c | 2 +- reactos/drivers/fs/ext2/super.c | 4 +- reactos/drivers/fs/minix/cache.c | 2 +- reactos/drivers/fs/vfat/close.c | 7 +++- reactos/drivers/fs/vfat/create.c | 29 +++++-------- reactos/drivers/fs/vfat/dirwr.c | 6 +-- reactos/drivers/fs/vfat/fat.c | 56 +++++++++++++------------- reactos/drivers/fs/vfat/iface.c | 6 +-- reactos/drivers/fs/vfat/rw.c | 28 ++++++------- reactos/include/ddk/ntifs.h | 10 ++--- reactos/ntoskrnl/cc/view.c | 33 +++++++-------- reactos/ntoskrnl/include/internal/cc.h | 4 +- reactos/ntoskrnl/mm/section.c | 8 ++-- reactos/ntoskrnl/ntoskrnl.def | 10 ++--- reactos/ntoskrnl/ntoskrnl.edf | 12 +++--- 15 files changed, 107 insertions(+), 110 deletions(-) diff --git a/reactos/drivers/fs/ext2/dir.c b/reactos/drivers/fs/ext2/dir.c index cf52d613cec..b2ebf3d08e3 100644 --- a/reactos/drivers/fs/ext2/dir.c +++ b/reactos/drivers/fs/ext2/dir.c @@ -310,7 +310,7 @@ NTSTATUS Ext2OpenFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject, DPRINT("Found file\n"); Fcb->inode = current_inode; - CcInitializeFileCache(FileObject, &Fcb->Bcb); + CcRosInitializeFileCache(FileObject, &Fcb->Bcb); FileObject->FsContext = Fcb; return(STATUS_SUCCESS); diff --git a/reactos/drivers/fs/ext2/super.c b/reactos/drivers/fs/ext2/super.c index 130c27e3482..686dc52b17b 100644 --- a/reactos/drivers/fs/ext2/super.c +++ b/reactos/drivers/fs/ext2/super.c @@ -54,7 +54,7 @@ NTSTATUS Ext2Close(PDEVICE_OBJECT DeviceObject, PIRP Irp) { if (Fcb->Bcb != NULL) { - CcReleaseFileCache(FileObject, Fcb->Bcb); + CcRosReleaseFileCache(FileObject, Fcb->Bcb); } ExFreePool(Fcb); FileObject->FsContext = NULL; @@ -110,7 +110,7 @@ NTSTATUS Ext2Mount(PDEVICE_OBJECT DeviceToMount) DPRINT("DeviceExt->StorageDevice %x\n", DeviceExt->StorageDevice); DeviceExt->FileObject = IoCreateStreamFileObject(NULL, DeviceObject); DeviceExt->superblock = superblock; - CcInitializeFileCache(DeviceExt->FileObject, + CcRosInitializeFileCache(DeviceExt->FileObject, &DeviceExt->Bcb); DPRINT("Ext2Mount() = STATUS_SUCCESS\n"); diff --git a/reactos/drivers/fs/minix/cache.c b/reactos/drivers/fs/minix/cache.c index 69ffa433417..295a99ce80e 100644 --- a/reactos/drivers/fs/minix/cache.c +++ b/reactos/drivers/fs/minix/cache.c @@ -27,7 +27,7 @@ NTSTATUS MinixRequestCacheBlock(PDEVICE_OBJECT DeviceObject, { BOOLEAN UptoDate; - CcRequestCacheSegment(Bcb, + CcRosRequestCacheSegment(Bcb, FileOffset, BaseAddress, &UptoDate, diff --git a/reactos/drivers/fs/vfat/close.c b/reactos/drivers/fs/vfat/close.c index 5d8c8f86630..84dbc43f9b6 100644 --- a/reactos/drivers/fs/vfat/close.c +++ b/reactos/drivers/fs/vfat/close.c @@ -1,4 +1,4 @@ -/* $Id: close.c,v 1.5 2001/03/09 14:40:28 dwelch Exp $ +/* $Id: close.c,v 1.6 2001/05/04 01:21:45 rex Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -43,13 +43,16 @@ VfatCloseFile (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject) pFcb = pCcb->pFcb; pFcb->RefCount--; + CHECKPOINT; if (pFcb->RefCount <= 0) { - CcReleaseFileCache(FileObject, pFcb->RFCB.Bcb); + CcRosReleaseFileCache(FileObject, pFcb->RFCB.Bcb); KeAcquireSpinLock (&DeviceExt->FcbListLock, &oldIrql); + CHECKPOINT; RemoveEntryList (&pFcb->FcbListEntry); KeReleaseSpinLock (&DeviceExt->FcbListLock, oldIrql); ExFreePool (pFcb); + CHECKPOINT; } ExFreePool (pCcb); return STATUS_SUCCESS; diff --git a/reactos/drivers/fs/vfat/create.c b/reactos/drivers/fs/vfat/create.c index 3241882c15d..9df8dd636e9 100644 --- a/reactos/drivers/fs/vfat/create.c +++ b/reactos/drivers/fs/vfat/create.c @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.24 2001/05/02 03:18:03 rex Exp $ +/* $Id: create.c,v 1.25 2001/05/04 01:21:45 rex Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -485,7 +485,7 @@ VfatOpenFile (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject, PVFATCCB newCCB; NTSTATUS Status; PWSTR AbsFileName = NULL; - ULONG BytesPerCluster; + ULONG BytesPerCluster, FileCacheQuantum; DPRINT ("VfatOpenFile(%08lx, %08lx, %S)\n", DeviceExt, FileObject, FileName); @@ -635,31 +635,24 @@ VfatOpenFile (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject, newCCB->pFcb = ParentFcb; newCCB->PtrFileObject = FileObject; ParentFcb->RefCount++; + ParentFcb->pDevExt = DeviceExt; /* FIXME : initialize all fields in FCB and CCB */ - vfatAddFCBToTable (DeviceExt, ParentFcb); - -/* vfat_wcsncpy (ParentFcb->PathName, FileName, MAX_PATH); - ParentFcb->ObjectName = ParentFcb->PathName + (current - FileName); */ - ParentFcb->pDevExt = DeviceExt; BytesPerCluster = DeviceExt->Boot->SectorsPerCluster * BLOCKSIZE; - if (BytesPerCluster >= PAGESIZE) - { - Status = CcInitializeFileCache(FileObject, &ParentFcb->RFCB.Bcb, - BytesPerCluster); - } - else - { - Status = CcInitializeFileCache(FileObject, &ParentFcb->RFCB.Bcb, - PAGESIZE); - } + FileCacheQuantum = (BytesPerCluster >= PAGESIZE) ? BytesPerCluster : PAGESIZE; + Status = CcRosInitializeFileCache(FileObject, + &ParentFcb->RFCB.Bcb, + FileCacheQuantum); if (!NT_SUCCESS(Status)) { - DbgPrint("CcInitializeFileCache failed\n"); + DbgPrint("CcRosInitializeFileCache failed\n"); KeBugCheck(0); } DPRINT ("file open, fcb=%x\n", ParentFcb); DPRINT ("FileSize %d\n", ParentFcb->entry.FileSize); + + vfatAddFCBToTable (DeviceExt, ParentFcb); + if (Fcb) ExFreePool (Fcb); if (AbsFileName) diff --git a/reactos/drivers/fs/vfat/dirwr.c b/reactos/drivers/fs/vfat/dirwr.c index c70541b49e5..1b873e22380 100644 --- a/reactos/drivers/fs/vfat/dirwr.c +++ b/reactos/drivers/fs/vfat/dirwr.c @@ -1,4 +1,4 @@ -/* $Id: dirwr.c,v 1.18 2001/05/02 03:18:03 rex Exp $ +/* $Id: dirwr.c,v 1.19 2001/05/04 01:21:45 rex Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -421,12 +421,12 @@ addEntry (PDEVICE_EXTENSION DeviceExt, BytesPerCluster = DeviceExt->Boot->SectorsPerCluster * BLOCKSIZE; if (BytesPerCluster >= PAGESIZE) { - Status = CcInitializeFileCache(pFileObject, &newFCB->RFCB.Bcb, + Status = CcRosInitializeFileCache(pFileObject, &newFCB->RFCB.Bcb, BytesPerCluster); } else { - Status = CcInitializeFileCache(pFileObject, &newFCB->RFCB.Bcb, + Status = CcRosInitializeFileCache(pFileObject, &newFCB->RFCB.Bcb, PAGESIZE); } diff --git a/reactos/drivers/fs/vfat/fat.c b/reactos/drivers/fs/vfat/fat.c index b105fb7cfa7..4f11d2f6626 100644 --- a/reactos/drivers/fs/vfat/fat.c +++ b/reactos/drivers/fs/vfat/fat.c @@ -1,5 +1,5 @@ /* - * $Id: fat.c,v 1.24 2001/04/29 21:08:14 cnettel Exp $ + * $Id: fat.c,v 1.25 2001/05/04 01:21:45 rex Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -40,7 +40,7 @@ Fat32GetNextCluster (PDEVICE_EXTENSION DeviceExt, FATOffset = (DeviceExt->FATStart * BLOCKSIZE) + (CurrentCluster * sizeof(ULONG)); - Status = CcRequestCacheSegment(DeviceExt->StorageBcb, + Status = CcRosRequestCacheSegment(DeviceExt->StorageBcb, PAGE_ROUND_DOWN(FATOffset), &BaseAddress, &Valid, @@ -57,7 +57,7 @@ Fat32GetNextCluster (PDEVICE_EXTENSION DeviceExt, BaseAddress); if (!NT_SUCCESS(Status)) { - CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE); + CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE); return(Status); } } @@ -65,7 +65,7 @@ Fat32GetNextCluster (PDEVICE_EXTENSION DeviceExt, CurrentCluster = *(PULONG)(BaseAddress + (FATOffset % PAGESIZE)); if (CurrentCluster >= 0xffffff8 && CurrentCluster <= 0xfffffff) CurrentCluster = 0xffffffff; - CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE); *NextCluster = CurrentCluster; return (STATUS_SUCCESS); } @@ -86,7 +86,7 @@ Fat16GetNextCluster (PDEVICE_EXTENSION DeviceExt, FATOffset = (DeviceExt->FATStart * BLOCKSIZE) + (CurrentCluster * 2); - Status = CcRequestCacheSegment(DeviceExt->StorageBcb, + Status = CcRosRequestCacheSegment(DeviceExt->StorageBcb, PAGE_ROUND_DOWN(FATOffset), &BaseAddress, &Valid, @@ -103,7 +103,7 @@ Fat16GetNextCluster (PDEVICE_EXTENSION DeviceExt, BaseAddress); if (!NT_SUCCESS(Status)) { - CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE); + CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE); return(Status); } } @@ -111,7 +111,7 @@ Fat16GetNextCluster (PDEVICE_EXTENSION DeviceExt, CurrentCluster = *((PUSHORT)(BaseAddress + (FATOffset % PAGESIZE))); if (CurrentCluster >= 0xfff8 && CurrentCluster <= 0xffff) CurrentCluster = 0xffffffff; - CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE); *NextCluster = CurrentCluster; return (STATUS_SUCCESS); } @@ -134,7 +134,7 @@ Fat12GetNextCluster (PDEVICE_EXTENSION DeviceExt, *NextCluster = 0; - Status = CcRequestCacheSegment(DeviceExt->Fat12StorageBcb, + Status = CcRosRequestCacheSegment(DeviceExt->Fat12StorageBcb, 0, &BaseAddress, &Valid, @@ -151,7 +151,7 @@ Fat12GetNextCluster (PDEVICE_EXTENSION DeviceExt, BaseAddress); if (!NT_SUCCESS(Status)) { - CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE); + CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE); return(Status); } } @@ -173,7 +173,7 @@ Fat12GetNextCluster (PDEVICE_EXTENSION DeviceExt, Entry = 0xffffffff; // DPRINT("Returning %x\n",Entry); *NextCluster = Entry; - CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE); return Entry == 0xffffffff ? STATUS_END_OF_FILE : STATUS_SUCCESS; } @@ -203,9 +203,9 @@ FAT16FindAvailableCluster (PDEVICE_EXTENSION DeviceExt, { if (CacheSeg != NULL) { - CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE); } - Status = CcRequestCacheSegment(DeviceExt->StorageBcb, + Status = CcRosRequestCacheSegment(DeviceExt->StorageBcb, PAGE_ROUND_DOWN(FatStart + i), &BaseAddress, &Valid, @@ -223,7 +223,7 @@ FAT16FindAvailableCluster (PDEVICE_EXTENSION DeviceExt, BaseAddress); if (!NT_SUCCESS(Status)) { - CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, + CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE); return(Status); } @@ -233,11 +233,11 @@ FAT16FindAvailableCluster (PDEVICE_EXTENSION DeviceExt, { DPRINT("Found available cluster 0x%x\n", i); *Cluster = i / 2; - CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE); return(STATUS_SUCCESS); } } - CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE); return(STATUS_DISK_FULL); } @@ -259,7 +259,7 @@ FAT12FindAvailableCluster (PDEVICE_EXTENSION DeviceExt, PULONG Cluster) *Cluster = 0; - Status = CcRequestCacheSegment(DeviceExt->Fat12StorageBcb, + Status = CcRosRequestCacheSegment(DeviceExt->Fat12StorageBcb, 0, &BaseAddress, &Valid, @@ -276,7 +276,7 @@ FAT12FindAvailableCluster (PDEVICE_EXTENSION DeviceExt, PULONG Cluster) BaseAddress); if (!NT_SUCCESS(Status)) { - CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE); + CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE); return(Status); } } @@ -301,11 +301,11 @@ FAT12FindAvailableCluster (PDEVICE_EXTENSION DeviceExt, PULONG Cluster) { DPRINT("Found available cluster 0x%x\n", i); *Cluster = i; - CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE); return(STATUS_SUCCESS); } } - CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE); return (STATUS_DISK_FULL); } @@ -380,7 +380,7 @@ FAT12CountAvailableClusters (PDEVICE_EXTENSION DeviceExt) ULONG numberofclusters; ExAcquireResourceSharedLite (&DeviceExt->FatResource, TRUE); - Status = CcRequestCacheSegment(DeviceExt->Fat12StorageBcb, + Status = CcRosRequestCacheSegment(DeviceExt->Fat12StorageBcb, 0, &BaseAddress, &Valid, @@ -398,7 +398,7 @@ FAT12CountAvailableClusters (PDEVICE_EXTENSION DeviceExt) BaseAddress); if (!NT_SUCCESS(Status)) { - CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE); + CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE); ExReleaseResourceLite (&DeviceExt->FatResource); return 0; // Will the caller understand NTSTATUS values? } @@ -423,7 +423,7 @@ FAT12CountAvailableClusters (PDEVICE_EXTENSION DeviceExt) ulCount++; } - CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE); + CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE); ExReleaseResourceLite (&DeviceExt->FatResource); return ulCount; @@ -514,7 +514,7 @@ FAT12WriteCluster (PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite, BOOLEAN Valid; PCACHE_SEGMENT CacheSeg; - Status = CcRequestCacheSegment(DeviceExt->Fat12StorageBcb, + Status = CcRosRequestCacheSegment(DeviceExt->Fat12StorageBcb, 0, &BaseAddress, &Valid, @@ -531,7 +531,7 @@ FAT12WriteCluster (PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite, BaseAddress); if (!NT_SUCCESS(Status)) { - CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE); + CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE); return(Status); } } @@ -573,7 +573,7 @@ FAT12WriteCluster (PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite, 1, CBlock + FATsector * 512); } } - CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE); return(STATUS_SUCCESS); } @@ -598,7 +598,7 @@ FAT16WriteCluster (PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite, for (i = 0; i < DeviceExt->Boot->FATCount; i++) { - Status = CcRequestCacheSegment(DeviceExt->StorageBcb, + Status = CcRosRequestCacheSegment(DeviceExt->StorageBcb, PAGE_ROUND_DOWN(FATOffset), &BaseAddress, &Valid, @@ -615,7 +615,7 @@ FAT16WriteCluster (PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite, BaseAddress); if (!NT_SUCCESS(Status)) { - CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE); + CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE); return(Status); } } @@ -627,7 +627,7 @@ FAT16WriteCluster (PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite, PAGE_ROUND_DOWN(FATOffset) / BLOCKSIZE, PAGESIZE / BLOCKSIZE, BaseAddress); - CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE); DPRINT("DeviceExt->Boot->FATSectors %d\n", DeviceExt->Boot->FATSectors); diff --git a/reactos/drivers/fs/vfat/iface.c b/reactos/drivers/fs/vfat/iface.c index b60da8a0b55..432167ebe0b 100644 --- a/reactos/drivers/fs/vfat/iface.c +++ b/reactos/drivers/fs/vfat/iface.c @@ -1,4 +1,4 @@ -/* $Id: iface.c,v 1.51 2001/03/07 13:44:40 ekohl Exp $ +/* $Id: iface.c,v 1.52 2001/05/04 01:21:45 rex Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -200,7 +200,7 @@ VfatMount (PDEVICE_OBJECT DeviceToMount) DeviceToMount); DeviceExt->StreamStorageDevice = IoCreateStreamFileObject(NULL, DeviceExt->StorageDevice); - Status = CcInitializeFileCache(DeviceExt->StreamStorageDevice, + Status = CcRosInitializeFileCache(DeviceExt->StreamStorageDevice, &DeviceExt->StorageBcb, PAGESIZE); if (!NT_SUCCESS(Status)) @@ -213,7 +213,7 @@ VfatMount (PDEVICE_OBJECT DeviceToMount) { DeviceExt->Fat12StorageDevice = IoCreateStreamFileObject(NULL, DeviceExt->StorageDevice); - Status = CcInitializeFileCache(DeviceExt->Fat12StorageDevice, + Status = CcRosInitializeFileCache(DeviceExt->Fat12StorageDevice, &DeviceExt->Fat12StorageBcb, PAGESIZE * 3); if (!NT_SUCCESS(Status)) diff --git a/reactos/drivers/fs/vfat/rw.c b/reactos/drivers/fs/vfat/rw.c index 48006b5a0d8..7b537ec75a1 100644 --- a/reactos/drivers/fs/vfat/rw.c +++ b/reactos/drivers/fs/vfat/rw.c @@ -1,5 +1,5 @@ -/* $Id: rw.c,v 1.23 2001/04/26 01:28:54 phreak Exp $ +/* $Id: rw.c,v 1.24 2001/05/04 01:21:45 rex Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -123,7 +123,7 @@ VfatReadBigCluster(PDEVICE_EXTENSION DeviceExt, if (!NoCache) { - Status = CcRequestCacheSegment(Fcb->RFCB.Bcb, + Status = CcRosRequestCacheSegment(Fcb->RFCB.Bcb, StartOffset, &BaseAddress, &Valid, @@ -162,7 +162,7 @@ VfatReadBigCluster(PDEVICE_EXTENSION DeviceExt, { if (!NoCache) { - CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE); + CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE); } else if (InternalOffset != 0) { @@ -180,7 +180,7 @@ VfatReadBigCluster(PDEVICE_EXTENSION DeviceExt, } if (!NoCache) { - CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE); } else if (InternalOffset != 0) { @@ -217,7 +217,7 @@ VfatReadSmallCluster(PDEVICE_EXTENSION DeviceExt, */ if (!NoCache) { - Status = CcRequestCacheSegment(Fcb->RFCB.Bcb, + Status = CcRosRequestCacheSegment(Fcb->RFCB.Bcb, StartOffset, &BaseAddress, &Valid, @@ -263,7 +263,7 @@ VfatReadSmallCluster(PDEVICE_EXTENSION DeviceExt, { if (!NoCache) { - CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE); + CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE); } else if (InternalOffset != 0) { @@ -301,7 +301,7 @@ VfatReadSmallCluster(PDEVICE_EXTENSION DeviceExt, } if (!NoCache) { - CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE); } else if (InternalOffset != 0) { @@ -489,7 +489,7 @@ VfatWriteBigCluster(PDEVICE_EXTENSION DeviceExt, */ if (!NoCache) { - Status = CcRequestCacheSegment(Fcb->RFCB.Bcb, + Status = CcRosRequestCacheSegment(Fcb->RFCB.Bcb, StartOffset, &BaseAddress, &Valid, @@ -529,7 +529,7 @@ VfatWriteBigCluster(PDEVICE_EXTENSION DeviceExt, { if (!NoCache) { - CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE); + CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE); } else if (InternalOffset != 0) { @@ -556,7 +556,7 @@ VfatWriteBigCluster(PDEVICE_EXTENSION DeviceExt, *CurrentCluster); if (!NoCache) { - CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE); } else if (InternalOffset != 0) { @@ -596,7 +596,7 @@ VfatWriteSmallCluster(PDEVICE_EXTENSION DeviceExt, if (!NoCache) { - Status = CcRequestCacheSegment(Fcb->RFCB.Bcb, + Status = CcRosRequestCacheSegment(Fcb->RFCB.Bcb, StartOffset, &BaseAddress, &Valid, @@ -644,7 +644,7 @@ VfatWriteSmallCluster(PDEVICE_EXTENSION DeviceExt, { if (!NoCache) { - CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE); + CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE); } else if (InternalOffset != 0) { @@ -699,7 +699,7 @@ VfatWriteSmallCluster(PDEVICE_EXTENSION DeviceExt, { if (!NoCache) { - CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE); + CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE); } else if (InternalOffset != 0) { @@ -717,7 +717,7 @@ VfatWriteSmallCluster(PDEVICE_EXTENSION DeviceExt, if (!NoCache) { - CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE); } else if (InternalOffset != 0) { diff --git a/reactos/include/ddk/ntifs.h b/reactos/include/ddk/ntifs.h index 17e8ada6159..de25705715c 100644 --- a/reactos/include/ddk/ntifs.h +++ b/reactos/include/ddk/ntifs.h @@ -12,23 +12,23 @@ struct _CACHE_SEGMENT; typedef struct _CACHE_SEGMENT* PCACHE_SEGMENT; NTSTATUS STDCALL -CcFlushCacheSegment (struct _CACHE_SEGMENT* CacheSeg); +CcRosFlushCacheSegment (struct _CACHE_SEGMENT* CacheSeg); NTSTATUS STDCALL -CcReleaseCacheSegment (struct _BCB* Bcb, +CcRosReleaseCacheSegment (struct _BCB* Bcb, struct _CACHE_SEGMENT* CacheSeg, BOOLEAN Valid); NTSTATUS STDCALL -CcRequestCacheSegment (struct _BCB* Bcb, +CcRosRequestCacheSegment (struct _BCB* Bcb, ULONG FileOffset, PVOID* BaseAddress, PBOOLEAN UptoDate, struct _CACHE_SEGMENT** CacheSeg); NTSTATUS STDCALL -CcInitializeFileCache (PFILE_OBJECT FileObject, +CcRosInitializeFileCache (PFILE_OBJECT FileObject, struct _BCB** Bcb, ULONG CacheSegmentSize); NTSTATUS STDCALL -CcReleaseFileCache (PFILE_OBJECT FileObject, +CcRosReleaseFileCache (PFILE_OBJECT FileObject, struct _BCB* Bcb); #include diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index 441e35219e5..5d965935f83 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -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: view.c,v 1.25 2001/05/01 23:08:18 chorns Exp $ +/* $Id: view.c,v 1.26 2001/05/04 01:21:43 rex Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -75,7 +75,7 @@ static KSPIN_LOCK BcbListLock; /* FUNCTIONS *****************************************************************/ NTSTATUS STDCALL -CcFlushCacheSegment(PCACHE_SEGMENT CacheSeg) +CcRosFlushCacheSegment(PCACHE_SEGMENT CacheSeg) /* * FUNCTION: Asks the FSD to flush the contents of the page back to disk */ @@ -91,7 +91,7 @@ CcFlushCacheSegment(PCACHE_SEGMENT CacheSeg) } NTSTATUS STDCALL -CcReleaseCacheSegment(PBCB Bcb, +CcRosReleaseCacheSegment(PBCB Bcb, PCACHE_SEGMENT CacheSeg, BOOLEAN Valid) { @@ -108,7 +108,7 @@ CcReleaseCacheSegment(PBCB Bcb, } NTSTATUS -CcGetCacheSegment(PBCB Bcb, +CcRosGetCacheSegment(PBCB Bcb, ULONG FileOffset, PULONG BaseOffset, PVOID* BaseAddress, @@ -184,7 +184,7 @@ CcGetCacheSegment(PBCB Bcb, } NTSTATUS STDCALL -CcRequestCacheSegment(PBCB Bcb, +CcRosRequestCacheSegment(PBCB Bcb, ULONG FileOffset, PVOID* BaseAddress, PBOOLEAN UptoDate, @@ -202,7 +202,7 @@ CcRequestCacheSegment(PBCB Bcb, KeBugCheck(0); } - return(CcGetCacheSegment(Bcb, + return(CcRosGetCacheSegment(Bcb, FileOffset, &BaseOffset, BaseAddress, @@ -220,7 +220,7 @@ CcFreeCachePage(PVOID Context, PVOID Address, ULONG PhysAddr) } NTSTATUS STDCALL -CcFreeCacheSegment(PBCB Bcb, PCACHE_SEGMENT CacheSeg) +CcRosFreeCacheSegment(PBCB Bcb, PCACHE_SEGMENT CacheSeg) /* * FUNCTION: Releases a cache segment associated with a BCB */ @@ -236,7 +236,7 @@ CcFreeCacheSegment(PBCB Bcb, PCACHE_SEGMENT CacheSeg) } NTSTATUS STDCALL -CcReleaseFileCache(PFILE_OBJECT FileObject, PBCB Bcb) +CcRosReleaseFileCache(PFILE_OBJECT FileObject, PBCB Bcb) /* * FUNCTION: Releases the BCB associated with a file object */ @@ -244,9 +244,9 @@ CcReleaseFileCache(PFILE_OBJECT FileObject, PBCB Bcb) PLIST_ENTRY current_entry; PCACHE_SEGMENT current; - DPRINT("CcReleaseFileCache(FileObject %x, Bcb %x)\n", FileObject, Bcb); + DPRINT("CcRosReleaseFileCache(FileObject %x, Bcb %x)\n", Bcb->FileObject, Bcb); - MmFreeSectionSegments(FileObject); + MmFreeSectionSegments(Bcb->FileObject); current_entry = Bcb->CacheSegmentListHead.Flink; while (current_entry != &Bcb->CacheSegmentListHead) @@ -254,25 +254,26 @@ CcReleaseFileCache(PFILE_OBJECT FileObject, PBCB Bcb) current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbListEntry); current_entry = current_entry->Flink; - CcFreeCacheSegment(Bcb, current); + CcRosFreeCacheSegment(Bcb, current); } - + + ObDereferenceObject (Bcb->FileObject); ExFreePool(Bcb); - DPRINT("CcReleaseFileCache() finished\n"); + DPRINT("CcRosReleaseFileCache() finished\n"); return(STATUS_SUCCESS); } NTSTATUS STDCALL -CcInitializeFileCache(PFILE_OBJECT FileObject, +CcRosInitializeFileCache(PFILE_OBJECT FileObject, PBCB* Bcb, ULONG CacheSegmentSize) /* * FUNCTION: Initializes a BCB for a file object */ { - DPRINT("CcInitializeFileCache(FileObject %x)\n",FileObject); + DPRINT("CcRosInitializeFileCache(FileObject %x)\n",FileObject); (*Bcb) = ExAllocatePoolWithTag(NonPagedPool, sizeof(BCB), TAG_BCB); if ((*Bcb) == NULL) @@ -289,7 +290,7 @@ CcInitializeFileCache(PFILE_OBJECT FileObject, KeInitializeSpinLock(&(*Bcb)->BcbLock); (*Bcb)->CacheSegmentSize = CacheSegmentSize; - DPRINT("Finished CcInitializeFileCache() = %x\n", *Bcb); + DPRINT("Finished CcRosInitializeFileCache() = %x\n", *Bcb); return(STATUS_SUCCESS); } diff --git a/reactos/ntoskrnl/include/internal/cc.h b/reactos/ntoskrnl/include/internal/cc.h index 86aeb84cc0c..8c23f2885e9 100644 --- a/reactos/ntoskrnl/include/internal/cc.h +++ b/reactos/ntoskrnl/include/internal/cc.h @@ -1,6 +1,6 @@ #ifndef __INCLUDE_INTERNAL_CC_H #define __INCLUDE_INTERNAL_CC_H -/* $Id: cc.h,v 1.4 2001/04/09 02:45:03 dwelch Exp $ */ +/* $Id: cc.h,v 1.5 2001/05/04 01:21:44 rex Exp $ */ #include typedef struct _BCB @@ -28,7 +28,7 @@ VOID STDCALL CcMdlReadCompleteDev (IN PMDL MdlChain, IN PDEVICE_OBJECT DeviceObject); NTSTATUS -CcGetCacheSegment(PBCB Bcb, +CcRosGetCacheSegment(PBCB Bcb, ULONG FileOffset, PULONG BaseOffset, PVOID* BaseAddress, diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index da7a51f6c22..0a4d2ed995d 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -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: section.c,v 1.56 2001/04/04 22:21:31 dwelch Exp $ +/* $Id: section.c,v 1.57 2001/05/04 01:21:44 rex Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/section.c @@ -273,7 +273,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, LARGE_INTEGER SegOffset; PHYSICAL_ADDRESS Addr; - Status = CcGetCacheSegment(Fcb->Bcb, + Status = CcRosGetCacheSegment(Fcb->Bcb, (ULONG)Offset->QuadPart, &BaseOffset, &BaseAddress, @@ -297,7 +297,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, TRUE); if (!NT_SUCCESS(Status)) { - CcReleaseCacheSegment(Fcb->Bcb, CacheSeg, FALSE); + CcRosReleaseCacheSegment(Fcb->Bcb, CacheSeg, FALSE); return(Status); } } @@ -307,7 +307,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, (*Page) = (PVOID)(ULONG)Addr.QuadPart; MmReferencePage((*Page)); - CcReleaseCacheSegment(Fcb->Bcb, CacheSeg, TRUE); + CcRosReleaseCacheSegment(Fcb->Bcb, CacheSeg, TRUE); return(STATUS_SUCCESS); } else diff --git a/reactos/ntoskrnl/ntoskrnl.def b/reactos/ntoskrnl/ntoskrnl.def index 8482add0719..ad87f8036f2 100644 --- a/reactos/ntoskrnl/ntoskrnl.def +++ b/reactos/ntoskrnl/ntoskrnl.def @@ -1,15 +1,15 @@ -; $Id: ntoskrnl.def,v 1.105 2001/05/01 23:08:17 chorns Exp $ +; $Id: ntoskrnl.def,v 1.106 2001/05/04 01:21:42 rex Exp $ ; ; reactos/ntoskrnl/ntoskrnl.def ; ; ReactOS Operating System ; EXPORTS -CcInitializeFileCache@12 +CcRosInitializeFileCache@12 CcMdlReadComplete@8 -CcRequestCacheSegment@20 -CcReleaseCacheSegment@12 -CcReleaseFileCache@8 +CcRosRequestCacheSegment@20 +CcRosReleaseCacheSegment@12 +CcRosReleaseFileCache@8 DbgBreakPoint@0 DbgBreakPointWithStatus@4 ;DbgLoadImageSymbols@12 diff --git a/reactos/ntoskrnl/ntoskrnl.edf b/reactos/ntoskrnl/ntoskrnl.edf index affdc8e3325..5d5cd60c4ba 100644 --- a/reactos/ntoskrnl/ntoskrnl.edf +++ b/reactos/ntoskrnl/ntoskrnl.edf @@ -1,15 +1,15 @@ -; $Id: ntoskrnl.edf,v 1.92 2001/05/01 23:08:18 chorns Exp $ +; $Id: ntoskrnl.edf,v 1.93 2001/05/04 01:21:43 rex Exp $ ; ; reactos/ntoskrnl/ntoskrnl.def ; ; ReactOS Operating System ; EXPORTS -CcInitializeFileCache=CcInitializeFileCache@12 +CcRosInitializeFileCache=CcRosInitializeFileCache@12 CcMdlReadComplete=CcMdlReadComplete@8 -CcRequestCacheSegment=CcRequestCacheSegment@20 -CcReleaseCacheSegment=CcReleaseCacheSegment@12 -CcReleaseFileCache=CcReleaseFileCache@8 +CcRosRequestCacheSegment=CcRosRequestCacheSegment@20 +CcRosReleaseCacheSegment=CcRosReleaseCacheSegment@12 +CcRosReleaseFileCache=CcRosReleaseFileCache@8 DbgBreakPoint=DbgBreakPoint@0 DbgBreakPointWithStatus=DbgBreakPointWithStatus@4 ;DbgLoadImageSymbols=DbgLoadImageSymbols@12 @@ -1129,4 +1129,4 @@ WRITE_PORT_BUFFER_USHORT=WRITE_PORT_BUFFER_USHORT@12 WRITE_PORT_UCHAR=WRITE_PORT_UCHAR@8 WRITE_PORT_ULONG=WRITE_PORT_ULONG@8 WRITE_PORT_USHORT=WRITE_PORT_USHORT@8 -KdSystemDebugControl = KdSystemDebugControl@4 \ No newline at end of file +KdSystemDebugControl = KdSystemDebugControl@4