mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
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
This commit is contained in:
parent
d9776acd0c
commit
ac9d3e30fb
15 changed files with 107 additions and 110 deletions
|
@ -310,7 +310,7 @@ NTSTATUS Ext2OpenFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
|
||||||
DPRINT("Found file\n");
|
DPRINT("Found file\n");
|
||||||
|
|
||||||
Fcb->inode = current_inode;
|
Fcb->inode = current_inode;
|
||||||
CcInitializeFileCache(FileObject, &Fcb->Bcb);
|
CcRosInitializeFileCache(FileObject, &Fcb->Bcb);
|
||||||
FileObject->FsContext = Fcb;
|
FileObject->FsContext = Fcb;
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
|
|
|
@ -54,7 +54,7 @@ NTSTATUS Ext2Close(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
{
|
{
|
||||||
if (Fcb->Bcb != NULL)
|
if (Fcb->Bcb != NULL)
|
||||||
{
|
{
|
||||||
CcReleaseFileCache(FileObject, Fcb->Bcb);
|
CcRosReleaseFileCache(FileObject, Fcb->Bcb);
|
||||||
}
|
}
|
||||||
ExFreePool(Fcb);
|
ExFreePool(Fcb);
|
||||||
FileObject->FsContext = NULL;
|
FileObject->FsContext = NULL;
|
||||||
|
@ -110,7 +110,7 @@ NTSTATUS Ext2Mount(PDEVICE_OBJECT DeviceToMount)
|
||||||
DPRINT("DeviceExt->StorageDevice %x\n", DeviceExt->StorageDevice);
|
DPRINT("DeviceExt->StorageDevice %x\n", DeviceExt->StorageDevice);
|
||||||
DeviceExt->FileObject = IoCreateStreamFileObject(NULL, DeviceObject);
|
DeviceExt->FileObject = IoCreateStreamFileObject(NULL, DeviceObject);
|
||||||
DeviceExt->superblock = superblock;
|
DeviceExt->superblock = superblock;
|
||||||
CcInitializeFileCache(DeviceExt->FileObject,
|
CcRosInitializeFileCache(DeviceExt->FileObject,
|
||||||
&DeviceExt->Bcb);
|
&DeviceExt->Bcb);
|
||||||
|
|
||||||
DPRINT("Ext2Mount() = STATUS_SUCCESS\n");
|
DPRINT("Ext2Mount() = STATUS_SUCCESS\n");
|
||||||
|
|
|
@ -27,7 +27,7 @@ NTSTATUS MinixRequestCacheBlock(PDEVICE_OBJECT DeviceObject,
|
||||||
{
|
{
|
||||||
BOOLEAN UptoDate;
|
BOOLEAN UptoDate;
|
||||||
|
|
||||||
CcRequestCacheSegment(Bcb,
|
CcRosRequestCacheSegment(Bcb,
|
||||||
FileOffset,
|
FileOffset,
|
||||||
BaseAddress,
|
BaseAddress,
|
||||||
&UptoDate,
|
&UptoDate,
|
||||||
|
|
|
@ -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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -43,13 +43,16 @@ VfatCloseFile (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject)
|
||||||
pFcb = pCcb->pFcb;
|
pFcb = pCcb->pFcb;
|
||||||
|
|
||||||
pFcb->RefCount--;
|
pFcb->RefCount--;
|
||||||
|
CHECKPOINT;
|
||||||
if (pFcb->RefCount <= 0)
|
if (pFcb->RefCount <= 0)
|
||||||
{
|
{
|
||||||
CcReleaseFileCache(FileObject, pFcb->RFCB.Bcb);
|
CcRosReleaseFileCache(FileObject, pFcb->RFCB.Bcb);
|
||||||
KeAcquireSpinLock (&DeviceExt->FcbListLock, &oldIrql);
|
KeAcquireSpinLock (&DeviceExt->FcbListLock, &oldIrql);
|
||||||
|
CHECKPOINT;
|
||||||
RemoveEntryList (&pFcb->FcbListEntry);
|
RemoveEntryList (&pFcb->FcbListEntry);
|
||||||
KeReleaseSpinLock (&DeviceExt->FcbListLock, oldIrql);
|
KeReleaseSpinLock (&DeviceExt->FcbListLock, oldIrql);
|
||||||
ExFreePool (pFcb);
|
ExFreePool (pFcb);
|
||||||
|
CHECKPOINT;
|
||||||
}
|
}
|
||||||
ExFreePool (pCcb);
|
ExFreePool (pCcb);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
|
@ -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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -485,7 +485,7 @@ VfatOpenFile (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
|
||||||
PVFATCCB newCCB;
|
PVFATCCB newCCB;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PWSTR AbsFileName = NULL;
|
PWSTR AbsFileName = NULL;
|
||||||
ULONG BytesPerCluster;
|
ULONG BytesPerCluster, FileCacheQuantum;
|
||||||
|
|
||||||
DPRINT ("VfatOpenFile(%08lx, %08lx, %S)\n", DeviceExt, FileObject, FileName);
|
DPRINT ("VfatOpenFile(%08lx, %08lx, %S)\n", DeviceExt, FileObject, FileName);
|
||||||
|
|
||||||
|
@ -635,31 +635,24 @@ VfatOpenFile (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
|
||||||
newCCB->pFcb = ParentFcb;
|
newCCB->pFcb = ParentFcb;
|
||||||
newCCB->PtrFileObject = FileObject;
|
newCCB->PtrFileObject = FileObject;
|
||||||
ParentFcb->RefCount++;
|
ParentFcb->RefCount++;
|
||||||
|
ParentFcb->pDevExt = DeviceExt;
|
||||||
/* FIXME : initialize all fields in FCB and CCB */
|
/* 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;
|
BytesPerCluster = DeviceExt->Boot->SectorsPerCluster * BLOCKSIZE;
|
||||||
if (BytesPerCluster >= PAGESIZE)
|
FileCacheQuantum = (BytesPerCluster >= PAGESIZE) ? BytesPerCluster : PAGESIZE;
|
||||||
{
|
Status = CcRosInitializeFileCache(FileObject,
|
||||||
Status = CcInitializeFileCache(FileObject, &ParentFcb->RFCB.Bcb,
|
&ParentFcb->RFCB.Bcb,
|
||||||
BytesPerCluster);
|
FileCacheQuantum);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Status = CcInitializeFileCache(FileObject, &ParentFcb->RFCB.Bcb,
|
|
||||||
PAGESIZE);
|
|
||||||
}
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DbgPrint("CcInitializeFileCache failed\n");
|
DbgPrint("CcRosInitializeFileCache failed\n");
|
||||||
KeBugCheck(0);
|
KeBugCheck(0);
|
||||||
}
|
}
|
||||||
DPRINT ("file open, fcb=%x\n", ParentFcb);
|
DPRINT ("file open, fcb=%x\n", ParentFcb);
|
||||||
DPRINT ("FileSize %d\n", ParentFcb->entry.FileSize);
|
DPRINT ("FileSize %d\n", ParentFcb->entry.FileSize);
|
||||||
|
|
||||||
|
vfatAddFCBToTable (DeviceExt, ParentFcb);
|
||||||
|
|
||||||
if (Fcb)
|
if (Fcb)
|
||||||
ExFreePool (Fcb);
|
ExFreePool (Fcb);
|
||||||
if (AbsFileName)
|
if (AbsFileName)
|
||||||
|
|
|
@ -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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -421,12 +421,12 @@ addEntry (PDEVICE_EXTENSION DeviceExt,
|
||||||
BytesPerCluster = DeviceExt->Boot->SectorsPerCluster * BLOCKSIZE;
|
BytesPerCluster = DeviceExt->Boot->SectorsPerCluster * BLOCKSIZE;
|
||||||
if (BytesPerCluster >= PAGESIZE)
|
if (BytesPerCluster >= PAGESIZE)
|
||||||
{
|
{
|
||||||
Status = CcInitializeFileCache(pFileObject, &newFCB->RFCB.Bcb,
|
Status = CcRosInitializeFileCache(pFileObject, &newFCB->RFCB.Bcb,
|
||||||
BytesPerCluster);
|
BytesPerCluster);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Status = CcInitializeFileCache(pFileObject, &newFCB->RFCB.Bcb,
|
Status = CcRosInitializeFileCache(pFileObject, &newFCB->RFCB.Bcb,
|
||||||
PAGESIZE);
|
PAGESIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -40,7 +40,7 @@ Fat32GetNextCluster (PDEVICE_EXTENSION DeviceExt,
|
||||||
FATOffset = (DeviceExt->FATStart * BLOCKSIZE) +
|
FATOffset = (DeviceExt->FATStart * BLOCKSIZE) +
|
||||||
(CurrentCluster * sizeof(ULONG));
|
(CurrentCluster * sizeof(ULONG));
|
||||||
|
|
||||||
Status = CcRequestCacheSegment(DeviceExt->StorageBcb,
|
Status = CcRosRequestCacheSegment(DeviceExt->StorageBcb,
|
||||||
PAGE_ROUND_DOWN(FATOffset),
|
PAGE_ROUND_DOWN(FATOffset),
|
||||||
&BaseAddress,
|
&BaseAddress,
|
||||||
&Valid,
|
&Valid,
|
||||||
|
@ -57,7 +57,7 @@ Fat32GetNextCluster (PDEVICE_EXTENSION DeviceExt,
|
||||||
BaseAddress);
|
BaseAddress);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE);
|
CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ Fat32GetNextCluster (PDEVICE_EXTENSION DeviceExt,
|
||||||
CurrentCluster = *(PULONG)(BaseAddress + (FATOffset % PAGESIZE));
|
CurrentCluster = *(PULONG)(BaseAddress + (FATOffset % PAGESIZE));
|
||||||
if (CurrentCluster >= 0xffffff8 && CurrentCluster <= 0xfffffff)
|
if (CurrentCluster >= 0xffffff8 && CurrentCluster <= 0xfffffff)
|
||||||
CurrentCluster = 0xffffffff;
|
CurrentCluster = 0xffffffff;
|
||||||
CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE);
|
CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE);
|
||||||
*NextCluster = CurrentCluster;
|
*NextCluster = CurrentCluster;
|
||||||
return (STATUS_SUCCESS);
|
return (STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ Fat16GetNextCluster (PDEVICE_EXTENSION DeviceExt,
|
||||||
|
|
||||||
FATOffset = (DeviceExt->FATStart * BLOCKSIZE) + (CurrentCluster * 2);
|
FATOffset = (DeviceExt->FATStart * BLOCKSIZE) + (CurrentCluster * 2);
|
||||||
|
|
||||||
Status = CcRequestCacheSegment(DeviceExt->StorageBcb,
|
Status = CcRosRequestCacheSegment(DeviceExt->StorageBcb,
|
||||||
PAGE_ROUND_DOWN(FATOffset),
|
PAGE_ROUND_DOWN(FATOffset),
|
||||||
&BaseAddress,
|
&BaseAddress,
|
||||||
&Valid,
|
&Valid,
|
||||||
|
@ -103,7 +103,7 @@ Fat16GetNextCluster (PDEVICE_EXTENSION DeviceExt,
|
||||||
BaseAddress);
|
BaseAddress);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE);
|
CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ Fat16GetNextCluster (PDEVICE_EXTENSION DeviceExt,
|
||||||
CurrentCluster = *((PUSHORT)(BaseAddress + (FATOffset % PAGESIZE)));
|
CurrentCluster = *((PUSHORT)(BaseAddress + (FATOffset % PAGESIZE)));
|
||||||
if (CurrentCluster >= 0xfff8 && CurrentCluster <= 0xffff)
|
if (CurrentCluster >= 0xfff8 && CurrentCluster <= 0xffff)
|
||||||
CurrentCluster = 0xffffffff;
|
CurrentCluster = 0xffffffff;
|
||||||
CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE);
|
CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE);
|
||||||
*NextCluster = CurrentCluster;
|
*NextCluster = CurrentCluster;
|
||||||
return (STATUS_SUCCESS);
|
return (STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ Fat12GetNextCluster (PDEVICE_EXTENSION DeviceExt,
|
||||||
|
|
||||||
*NextCluster = 0;
|
*NextCluster = 0;
|
||||||
|
|
||||||
Status = CcRequestCacheSegment(DeviceExt->Fat12StorageBcb,
|
Status = CcRosRequestCacheSegment(DeviceExt->Fat12StorageBcb,
|
||||||
0,
|
0,
|
||||||
&BaseAddress,
|
&BaseAddress,
|
||||||
&Valid,
|
&Valid,
|
||||||
|
@ -151,7 +151,7 @@ Fat12GetNextCluster (PDEVICE_EXTENSION DeviceExt,
|
||||||
BaseAddress);
|
BaseAddress);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE);
|
CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ Fat12GetNextCluster (PDEVICE_EXTENSION DeviceExt,
|
||||||
Entry = 0xffffffff;
|
Entry = 0xffffffff;
|
||||||
// DPRINT("Returning %x\n",Entry);
|
// DPRINT("Returning %x\n",Entry);
|
||||||
*NextCluster = Entry;
|
*NextCluster = Entry;
|
||||||
CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE);
|
CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE);
|
||||||
return Entry == 0xffffffff ? STATUS_END_OF_FILE : STATUS_SUCCESS;
|
return Entry == 0xffffffff ? STATUS_END_OF_FILE : STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,9 +203,9 @@ FAT16FindAvailableCluster (PDEVICE_EXTENSION DeviceExt,
|
||||||
{
|
{
|
||||||
if (CacheSeg != NULL)
|
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),
|
PAGE_ROUND_DOWN(FatStart + i),
|
||||||
&BaseAddress,
|
&BaseAddress,
|
||||||
&Valid,
|
&Valid,
|
||||||
|
@ -223,7 +223,7 @@ FAT16FindAvailableCluster (PDEVICE_EXTENSION DeviceExt,
|
||||||
BaseAddress);
|
BaseAddress);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg,
|
CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg,
|
||||||
FALSE);
|
FALSE);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
@ -233,11 +233,11 @@ FAT16FindAvailableCluster (PDEVICE_EXTENSION DeviceExt,
|
||||||
{
|
{
|
||||||
DPRINT("Found available cluster 0x%x\n", i);
|
DPRINT("Found available cluster 0x%x\n", i);
|
||||||
*Cluster = i / 2;
|
*Cluster = i / 2;
|
||||||
CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE);
|
CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE);
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE);
|
CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE);
|
||||||
return(STATUS_DISK_FULL);
|
return(STATUS_DISK_FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ FAT12FindAvailableCluster (PDEVICE_EXTENSION DeviceExt, PULONG Cluster)
|
||||||
|
|
||||||
*Cluster = 0;
|
*Cluster = 0;
|
||||||
|
|
||||||
Status = CcRequestCacheSegment(DeviceExt->Fat12StorageBcb,
|
Status = CcRosRequestCacheSegment(DeviceExt->Fat12StorageBcb,
|
||||||
0,
|
0,
|
||||||
&BaseAddress,
|
&BaseAddress,
|
||||||
&Valid,
|
&Valid,
|
||||||
|
@ -276,7 +276,7 @@ FAT12FindAvailableCluster (PDEVICE_EXTENSION DeviceExt, PULONG Cluster)
|
||||||
BaseAddress);
|
BaseAddress);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE);
|
CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -301,11 +301,11 @@ FAT12FindAvailableCluster (PDEVICE_EXTENSION DeviceExt, PULONG Cluster)
|
||||||
{
|
{
|
||||||
DPRINT("Found available cluster 0x%x\n", i);
|
DPRINT("Found available cluster 0x%x\n", i);
|
||||||
*Cluster = i;
|
*Cluster = i;
|
||||||
CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE);
|
CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE);
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE);
|
CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE);
|
||||||
return (STATUS_DISK_FULL);
|
return (STATUS_DISK_FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ FAT12CountAvailableClusters (PDEVICE_EXTENSION DeviceExt)
|
||||||
ULONG numberofclusters;
|
ULONG numberofclusters;
|
||||||
|
|
||||||
ExAcquireResourceSharedLite (&DeviceExt->FatResource, TRUE);
|
ExAcquireResourceSharedLite (&DeviceExt->FatResource, TRUE);
|
||||||
Status = CcRequestCacheSegment(DeviceExt->Fat12StorageBcb,
|
Status = CcRosRequestCacheSegment(DeviceExt->Fat12StorageBcb,
|
||||||
0,
|
0,
|
||||||
&BaseAddress,
|
&BaseAddress,
|
||||||
&Valid,
|
&Valid,
|
||||||
|
@ -398,7 +398,7 @@ FAT12CountAvailableClusters (PDEVICE_EXTENSION DeviceExt)
|
||||||
BaseAddress);
|
BaseAddress);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE);
|
CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE);
|
||||||
ExReleaseResourceLite (&DeviceExt->FatResource);
|
ExReleaseResourceLite (&DeviceExt->FatResource);
|
||||||
return 0; // Will the caller understand NTSTATUS values?
|
return 0; // Will the caller understand NTSTATUS values?
|
||||||
}
|
}
|
||||||
|
@ -423,7 +423,7 @@ FAT12CountAvailableClusters (PDEVICE_EXTENSION DeviceExt)
|
||||||
ulCount++;
|
ulCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE);
|
CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE);
|
||||||
ExReleaseResourceLite (&DeviceExt->FatResource);
|
ExReleaseResourceLite (&DeviceExt->FatResource);
|
||||||
|
|
||||||
return ulCount;
|
return ulCount;
|
||||||
|
@ -514,7 +514,7 @@ FAT12WriteCluster (PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite,
|
||||||
BOOLEAN Valid;
|
BOOLEAN Valid;
|
||||||
PCACHE_SEGMENT CacheSeg;
|
PCACHE_SEGMENT CacheSeg;
|
||||||
|
|
||||||
Status = CcRequestCacheSegment(DeviceExt->Fat12StorageBcb,
|
Status = CcRosRequestCacheSegment(DeviceExt->Fat12StorageBcb,
|
||||||
0,
|
0,
|
||||||
&BaseAddress,
|
&BaseAddress,
|
||||||
&Valid,
|
&Valid,
|
||||||
|
@ -531,7 +531,7 @@ FAT12WriteCluster (PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite,
|
||||||
BaseAddress);
|
BaseAddress);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE);
|
CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, FALSE);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -573,7 +573,7 @@ FAT12WriteCluster (PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite,
|
||||||
1, CBlock + FATsector * 512);
|
1, CBlock + FATsector * 512);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CcReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE);
|
CcRosReleaseCacheSegment(DeviceExt->Fat12StorageBcb, CacheSeg, TRUE);
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -598,7 +598,7 @@ FAT16WriteCluster (PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite,
|
||||||
|
|
||||||
for (i = 0; i < DeviceExt->Boot->FATCount; i++)
|
for (i = 0; i < DeviceExt->Boot->FATCount; i++)
|
||||||
{
|
{
|
||||||
Status = CcRequestCacheSegment(DeviceExt->StorageBcb,
|
Status = CcRosRequestCacheSegment(DeviceExt->StorageBcb,
|
||||||
PAGE_ROUND_DOWN(FATOffset),
|
PAGE_ROUND_DOWN(FATOffset),
|
||||||
&BaseAddress,
|
&BaseAddress,
|
||||||
&Valid,
|
&Valid,
|
||||||
|
@ -615,7 +615,7 @@ FAT16WriteCluster (PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite,
|
||||||
BaseAddress);
|
BaseAddress);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE);
|
CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, FALSE);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -627,7 +627,7 @@ FAT16WriteCluster (PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite,
|
||||||
PAGE_ROUND_DOWN(FATOffset) / BLOCKSIZE,
|
PAGE_ROUND_DOWN(FATOffset) / BLOCKSIZE,
|
||||||
PAGESIZE / BLOCKSIZE,
|
PAGESIZE / BLOCKSIZE,
|
||||||
BaseAddress);
|
BaseAddress);
|
||||||
CcReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE);
|
CcRosReleaseCacheSegment(DeviceExt->StorageBcb, CacheSeg, TRUE);
|
||||||
|
|
||||||
DPRINT("DeviceExt->Boot->FATSectors %d\n",
|
DPRINT("DeviceExt->Boot->FATSectors %d\n",
|
||||||
DeviceExt->Boot->FATSectors);
|
DeviceExt->Boot->FATSectors);
|
||||||
|
|
|
@ -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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -200,7 +200,7 @@ VfatMount (PDEVICE_OBJECT DeviceToMount)
|
||||||
DeviceToMount);
|
DeviceToMount);
|
||||||
DeviceExt->StreamStorageDevice = IoCreateStreamFileObject(NULL,
|
DeviceExt->StreamStorageDevice = IoCreateStreamFileObject(NULL,
|
||||||
DeviceExt->StorageDevice);
|
DeviceExt->StorageDevice);
|
||||||
Status = CcInitializeFileCache(DeviceExt->StreamStorageDevice,
|
Status = CcRosInitializeFileCache(DeviceExt->StreamStorageDevice,
|
||||||
&DeviceExt->StorageBcb,
|
&DeviceExt->StorageBcb,
|
||||||
PAGESIZE);
|
PAGESIZE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
@ -213,7 +213,7 @@ VfatMount (PDEVICE_OBJECT DeviceToMount)
|
||||||
{
|
{
|
||||||
DeviceExt->Fat12StorageDevice =
|
DeviceExt->Fat12StorageDevice =
|
||||||
IoCreateStreamFileObject(NULL, DeviceExt->StorageDevice);
|
IoCreateStreamFileObject(NULL, DeviceExt->StorageDevice);
|
||||||
Status = CcInitializeFileCache(DeviceExt->Fat12StorageDevice,
|
Status = CcRosInitializeFileCache(DeviceExt->Fat12StorageDevice,
|
||||||
&DeviceExt->Fat12StorageBcb,
|
&DeviceExt->Fat12StorageBcb,
|
||||||
PAGESIZE * 3);
|
PAGESIZE * 3);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
|
|
@ -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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -123,7 +123,7 @@ VfatReadBigCluster(PDEVICE_EXTENSION DeviceExt,
|
||||||
|
|
||||||
if (!NoCache)
|
if (!NoCache)
|
||||||
{
|
{
|
||||||
Status = CcRequestCacheSegment(Fcb->RFCB.Bcb,
|
Status = CcRosRequestCacheSegment(Fcb->RFCB.Bcb,
|
||||||
StartOffset,
|
StartOffset,
|
||||||
&BaseAddress,
|
&BaseAddress,
|
||||||
&Valid,
|
&Valid,
|
||||||
|
@ -162,7 +162,7 @@ VfatReadBigCluster(PDEVICE_EXTENSION DeviceExt,
|
||||||
{
|
{
|
||||||
if (!NoCache)
|
if (!NoCache)
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE);
|
CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE);
|
||||||
}
|
}
|
||||||
else if (InternalOffset != 0)
|
else if (InternalOffset != 0)
|
||||||
{
|
{
|
||||||
|
@ -180,7 +180,7 @@ VfatReadBigCluster(PDEVICE_EXTENSION DeviceExt,
|
||||||
}
|
}
|
||||||
if (!NoCache)
|
if (!NoCache)
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE);
|
CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE);
|
||||||
}
|
}
|
||||||
else if (InternalOffset != 0)
|
else if (InternalOffset != 0)
|
||||||
{
|
{
|
||||||
|
@ -217,7 +217,7 @@ VfatReadSmallCluster(PDEVICE_EXTENSION DeviceExt,
|
||||||
*/
|
*/
|
||||||
if (!NoCache)
|
if (!NoCache)
|
||||||
{
|
{
|
||||||
Status = CcRequestCacheSegment(Fcb->RFCB.Bcb,
|
Status = CcRosRequestCacheSegment(Fcb->RFCB.Bcb,
|
||||||
StartOffset,
|
StartOffset,
|
||||||
&BaseAddress,
|
&BaseAddress,
|
||||||
&Valid,
|
&Valid,
|
||||||
|
@ -263,7 +263,7 @@ VfatReadSmallCluster(PDEVICE_EXTENSION DeviceExt,
|
||||||
{
|
{
|
||||||
if (!NoCache)
|
if (!NoCache)
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE);
|
CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE);
|
||||||
}
|
}
|
||||||
else if (InternalOffset != 0)
|
else if (InternalOffset != 0)
|
||||||
{
|
{
|
||||||
|
@ -301,7 +301,7 @@ VfatReadSmallCluster(PDEVICE_EXTENSION DeviceExt,
|
||||||
}
|
}
|
||||||
if (!NoCache)
|
if (!NoCache)
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE);
|
CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE);
|
||||||
}
|
}
|
||||||
else if (InternalOffset != 0)
|
else if (InternalOffset != 0)
|
||||||
{
|
{
|
||||||
|
@ -489,7 +489,7 @@ VfatWriteBigCluster(PDEVICE_EXTENSION DeviceExt,
|
||||||
*/
|
*/
|
||||||
if (!NoCache)
|
if (!NoCache)
|
||||||
{
|
{
|
||||||
Status = CcRequestCacheSegment(Fcb->RFCB.Bcb,
|
Status = CcRosRequestCacheSegment(Fcb->RFCB.Bcb,
|
||||||
StartOffset,
|
StartOffset,
|
||||||
&BaseAddress,
|
&BaseAddress,
|
||||||
&Valid,
|
&Valid,
|
||||||
|
@ -529,7 +529,7 @@ VfatWriteBigCluster(PDEVICE_EXTENSION DeviceExt,
|
||||||
{
|
{
|
||||||
if (!NoCache)
|
if (!NoCache)
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE);
|
CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE);
|
||||||
}
|
}
|
||||||
else if (InternalOffset != 0)
|
else if (InternalOffset != 0)
|
||||||
{
|
{
|
||||||
|
@ -556,7 +556,7 @@ VfatWriteBigCluster(PDEVICE_EXTENSION DeviceExt,
|
||||||
*CurrentCluster);
|
*CurrentCluster);
|
||||||
if (!NoCache)
|
if (!NoCache)
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE);
|
CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE);
|
||||||
}
|
}
|
||||||
else if (InternalOffset != 0)
|
else if (InternalOffset != 0)
|
||||||
{
|
{
|
||||||
|
@ -596,7 +596,7 @@ VfatWriteSmallCluster(PDEVICE_EXTENSION DeviceExt,
|
||||||
|
|
||||||
if (!NoCache)
|
if (!NoCache)
|
||||||
{
|
{
|
||||||
Status = CcRequestCacheSegment(Fcb->RFCB.Bcb,
|
Status = CcRosRequestCacheSegment(Fcb->RFCB.Bcb,
|
||||||
StartOffset,
|
StartOffset,
|
||||||
&BaseAddress,
|
&BaseAddress,
|
||||||
&Valid,
|
&Valid,
|
||||||
|
@ -644,7 +644,7 @@ VfatWriteSmallCluster(PDEVICE_EXTENSION DeviceExt,
|
||||||
{
|
{
|
||||||
if (!NoCache)
|
if (!NoCache)
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE);
|
CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE);
|
||||||
}
|
}
|
||||||
else if (InternalOffset != 0)
|
else if (InternalOffset != 0)
|
||||||
{
|
{
|
||||||
|
@ -699,7 +699,7 @@ VfatWriteSmallCluster(PDEVICE_EXTENSION DeviceExt,
|
||||||
{
|
{
|
||||||
if (!NoCache)
|
if (!NoCache)
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE);
|
CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, FALSE);
|
||||||
}
|
}
|
||||||
else if (InternalOffset != 0)
|
else if (InternalOffset != 0)
|
||||||
{
|
{
|
||||||
|
@ -717,7 +717,7 @@ VfatWriteSmallCluster(PDEVICE_EXTENSION DeviceExt,
|
||||||
|
|
||||||
if (!NoCache)
|
if (!NoCache)
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE);
|
CcRosReleaseCacheSegment(Fcb->RFCB.Bcb, CacheSeg, TRUE);
|
||||||
}
|
}
|
||||||
else if (InternalOffset != 0)
|
else if (InternalOffset != 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,23 +12,23 @@ struct _CACHE_SEGMENT;
|
||||||
typedef struct _CACHE_SEGMENT* PCACHE_SEGMENT;
|
typedef struct _CACHE_SEGMENT* PCACHE_SEGMENT;
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CcFlushCacheSegment (struct _CACHE_SEGMENT* CacheSeg);
|
CcRosFlushCacheSegment (struct _CACHE_SEGMENT* CacheSeg);
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CcReleaseCacheSegment (struct _BCB* Bcb,
|
CcRosReleaseCacheSegment (struct _BCB* Bcb,
|
||||||
struct _CACHE_SEGMENT* CacheSeg,
|
struct _CACHE_SEGMENT* CacheSeg,
|
||||||
BOOLEAN Valid);
|
BOOLEAN Valid);
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CcRequestCacheSegment (struct _BCB* Bcb,
|
CcRosRequestCacheSegment (struct _BCB* Bcb,
|
||||||
ULONG FileOffset,
|
ULONG FileOffset,
|
||||||
PVOID* BaseAddress,
|
PVOID* BaseAddress,
|
||||||
PBOOLEAN UptoDate,
|
PBOOLEAN UptoDate,
|
||||||
struct _CACHE_SEGMENT** CacheSeg);
|
struct _CACHE_SEGMENT** CacheSeg);
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CcInitializeFileCache (PFILE_OBJECT FileObject,
|
CcRosInitializeFileCache (PFILE_OBJECT FileObject,
|
||||||
struct _BCB** Bcb,
|
struct _BCB** Bcb,
|
||||||
ULONG CacheSegmentSize);
|
ULONG CacheSegmentSize);
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CcReleaseFileCache (PFILE_OBJECT FileObject,
|
CcRosReleaseFileCache (PFILE_OBJECT FileObject,
|
||||||
struct _BCB* Bcb);
|
struct _BCB* Bcb);
|
||||||
|
|
||||||
#include <ddk/cctypes.h>
|
#include <ddk/cctypes.h>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* 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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -75,7 +75,7 @@ static KSPIN_LOCK BcbListLock;
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CcFlushCacheSegment(PCACHE_SEGMENT CacheSeg)
|
CcRosFlushCacheSegment(PCACHE_SEGMENT CacheSeg)
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Asks the FSD to flush the contents of the page back to disk
|
* FUNCTION: Asks the FSD to flush the contents of the page back to disk
|
||||||
*/
|
*/
|
||||||
|
@ -91,7 +91,7 @@ CcFlushCacheSegment(PCACHE_SEGMENT CacheSeg)
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CcReleaseCacheSegment(PBCB Bcb,
|
CcRosReleaseCacheSegment(PBCB Bcb,
|
||||||
PCACHE_SEGMENT CacheSeg,
|
PCACHE_SEGMENT CacheSeg,
|
||||||
BOOLEAN Valid)
|
BOOLEAN Valid)
|
||||||
{
|
{
|
||||||
|
@ -108,7 +108,7 @@ CcReleaseCacheSegment(PBCB Bcb,
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
CcGetCacheSegment(PBCB Bcb,
|
CcRosGetCacheSegment(PBCB Bcb,
|
||||||
ULONG FileOffset,
|
ULONG FileOffset,
|
||||||
PULONG BaseOffset,
|
PULONG BaseOffset,
|
||||||
PVOID* BaseAddress,
|
PVOID* BaseAddress,
|
||||||
|
@ -184,7 +184,7 @@ CcGetCacheSegment(PBCB Bcb,
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CcRequestCacheSegment(PBCB Bcb,
|
CcRosRequestCacheSegment(PBCB Bcb,
|
||||||
ULONG FileOffset,
|
ULONG FileOffset,
|
||||||
PVOID* BaseAddress,
|
PVOID* BaseAddress,
|
||||||
PBOOLEAN UptoDate,
|
PBOOLEAN UptoDate,
|
||||||
|
@ -202,7 +202,7 @@ CcRequestCacheSegment(PBCB Bcb,
|
||||||
KeBugCheck(0);
|
KeBugCheck(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(CcGetCacheSegment(Bcb,
|
return(CcRosGetCacheSegment(Bcb,
|
||||||
FileOffset,
|
FileOffset,
|
||||||
&BaseOffset,
|
&BaseOffset,
|
||||||
BaseAddress,
|
BaseAddress,
|
||||||
|
@ -220,7 +220,7 @@ CcFreeCachePage(PVOID Context, PVOID Address, ULONG PhysAddr)
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CcFreeCacheSegment(PBCB Bcb, PCACHE_SEGMENT CacheSeg)
|
CcRosFreeCacheSegment(PBCB Bcb, PCACHE_SEGMENT CacheSeg)
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Releases a cache segment associated with a BCB
|
* FUNCTION: Releases a cache segment associated with a BCB
|
||||||
*/
|
*/
|
||||||
|
@ -236,7 +236,7 @@ CcFreeCacheSegment(PBCB Bcb, PCACHE_SEGMENT CacheSeg)
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CcReleaseFileCache(PFILE_OBJECT FileObject, PBCB Bcb)
|
CcRosReleaseFileCache(PFILE_OBJECT FileObject, PBCB Bcb)
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Releases the BCB associated with a file object
|
* FUNCTION: Releases the BCB associated with a file object
|
||||||
*/
|
*/
|
||||||
|
@ -244,9 +244,9 @@ CcReleaseFileCache(PFILE_OBJECT FileObject, PBCB Bcb)
|
||||||
PLIST_ENTRY current_entry;
|
PLIST_ENTRY current_entry;
|
||||||
PCACHE_SEGMENT current;
|
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;
|
current_entry = Bcb->CacheSegmentListHead.Flink;
|
||||||
while (current_entry != &Bcb->CacheSegmentListHead)
|
while (current_entry != &Bcb->CacheSegmentListHead)
|
||||||
|
@ -254,25 +254,26 @@ CcReleaseFileCache(PFILE_OBJECT FileObject, PBCB Bcb)
|
||||||
current =
|
current =
|
||||||
CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbListEntry);
|
CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbListEntry);
|
||||||
current_entry = current_entry->Flink;
|
current_entry = current_entry->Flink;
|
||||||
CcFreeCacheSegment(Bcb, current);
|
CcRosFreeCacheSegment(Bcb, current);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ObDereferenceObject (Bcb->FileObject);
|
||||||
ExFreePool(Bcb);
|
ExFreePool(Bcb);
|
||||||
|
|
||||||
DPRINT("CcReleaseFileCache() finished\n");
|
DPRINT("CcRosReleaseFileCache() finished\n");
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CcInitializeFileCache(PFILE_OBJECT FileObject,
|
CcRosInitializeFileCache(PFILE_OBJECT FileObject,
|
||||||
PBCB* Bcb,
|
PBCB* Bcb,
|
||||||
ULONG CacheSegmentSize)
|
ULONG CacheSegmentSize)
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Initializes a BCB for a file object
|
* 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);
|
(*Bcb) = ExAllocatePoolWithTag(NonPagedPool, sizeof(BCB), TAG_BCB);
|
||||||
if ((*Bcb) == NULL)
|
if ((*Bcb) == NULL)
|
||||||
|
@ -289,7 +290,7 @@ CcInitializeFileCache(PFILE_OBJECT FileObject,
|
||||||
KeInitializeSpinLock(&(*Bcb)->BcbLock);
|
KeInitializeSpinLock(&(*Bcb)->BcbLock);
|
||||||
(*Bcb)->CacheSegmentSize = CacheSegmentSize;
|
(*Bcb)->CacheSegmentSize = CacheSegmentSize;
|
||||||
|
|
||||||
DPRINT("Finished CcInitializeFileCache() = %x\n", *Bcb);
|
DPRINT("Finished CcRosInitializeFileCache() = %x\n", *Bcb);
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef __INCLUDE_INTERNAL_CC_H
|
#ifndef __INCLUDE_INTERNAL_CC_H
|
||||||
#define __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 <ddk/ntifs.h>
|
#include <ddk/ntifs.h>
|
||||||
|
|
||||||
typedef struct _BCB
|
typedef struct _BCB
|
||||||
|
@ -28,7 +28,7 @@ VOID STDCALL
|
||||||
CcMdlReadCompleteDev (IN PMDL MdlChain,
|
CcMdlReadCompleteDev (IN PMDL MdlChain,
|
||||||
IN PDEVICE_OBJECT DeviceObject);
|
IN PDEVICE_OBJECT DeviceObject);
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
CcGetCacheSegment(PBCB Bcb,
|
CcRosGetCacheSegment(PBCB Bcb,
|
||||||
ULONG FileOffset,
|
ULONG FileOffset,
|
||||||
PULONG BaseOffset,
|
PULONG BaseOffset,
|
||||||
PVOID* BaseAddress,
|
PVOID* BaseAddress,
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* 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
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/mm/section.c
|
* FILE: ntoskrnl/mm/section.c
|
||||||
|
@ -273,7 +273,7 @@ MiReadPage(PMEMORY_AREA MemoryArea,
|
||||||
LARGE_INTEGER SegOffset;
|
LARGE_INTEGER SegOffset;
|
||||||
PHYSICAL_ADDRESS Addr;
|
PHYSICAL_ADDRESS Addr;
|
||||||
|
|
||||||
Status = CcGetCacheSegment(Fcb->Bcb,
|
Status = CcRosGetCacheSegment(Fcb->Bcb,
|
||||||
(ULONG)Offset->QuadPart,
|
(ULONG)Offset->QuadPart,
|
||||||
&BaseOffset,
|
&BaseOffset,
|
||||||
&BaseAddress,
|
&BaseAddress,
|
||||||
|
@ -297,7 +297,7 @@ MiReadPage(PMEMORY_AREA MemoryArea,
|
||||||
TRUE);
|
TRUE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
CcReleaseCacheSegment(Fcb->Bcb, CacheSeg, FALSE);
|
CcRosReleaseCacheSegment(Fcb->Bcb, CacheSeg, FALSE);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,7 @@ MiReadPage(PMEMORY_AREA MemoryArea,
|
||||||
(*Page) = (PVOID)(ULONG)Addr.QuadPart;
|
(*Page) = (PVOID)(ULONG)Addr.QuadPart;
|
||||||
MmReferencePage((*Page));
|
MmReferencePage((*Page));
|
||||||
|
|
||||||
CcReleaseCacheSegment(Fcb->Bcb, CacheSeg, TRUE);
|
CcRosReleaseCacheSegment(Fcb->Bcb, CacheSeg, TRUE);
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -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/ntoskrnl/ntoskrnl.def
|
||||||
;
|
;
|
||||||
; ReactOS Operating System
|
; ReactOS Operating System
|
||||||
;
|
;
|
||||||
EXPORTS
|
EXPORTS
|
||||||
CcInitializeFileCache@12
|
CcRosInitializeFileCache@12
|
||||||
CcMdlReadComplete@8
|
CcMdlReadComplete@8
|
||||||
CcRequestCacheSegment@20
|
CcRosRequestCacheSegment@20
|
||||||
CcReleaseCacheSegment@12
|
CcRosReleaseCacheSegment@12
|
||||||
CcReleaseFileCache@8
|
CcRosReleaseFileCache@8
|
||||||
DbgBreakPoint@0
|
DbgBreakPoint@0
|
||||||
DbgBreakPointWithStatus@4
|
DbgBreakPointWithStatus@4
|
||||||
;DbgLoadImageSymbols@12
|
;DbgLoadImageSymbols@12
|
||||||
|
|
|
@ -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/ntoskrnl/ntoskrnl.def
|
||||||
;
|
;
|
||||||
; ReactOS Operating System
|
; ReactOS Operating System
|
||||||
;
|
;
|
||||||
EXPORTS
|
EXPORTS
|
||||||
CcInitializeFileCache=CcInitializeFileCache@12
|
CcRosInitializeFileCache=CcRosInitializeFileCache@12
|
||||||
CcMdlReadComplete=CcMdlReadComplete@8
|
CcMdlReadComplete=CcMdlReadComplete@8
|
||||||
CcRequestCacheSegment=CcRequestCacheSegment@20
|
CcRosRequestCacheSegment=CcRosRequestCacheSegment@20
|
||||||
CcReleaseCacheSegment=CcReleaseCacheSegment@12
|
CcRosReleaseCacheSegment=CcRosReleaseCacheSegment@12
|
||||||
CcReleaseFileCache=CcReleaseFileCache@8
|
CcRosReleaseFileCache=CcRosReleaseFileCache@8
|
||||||
DbgBreakPoint=DbgBreakPoint@0
|
DbgBreakPoint=DbgBreakPoint@0
|
||||||
DbgBreakPointWithStatus=DbgBreakPointWithStatus@4
|
DbgBreakPointWithStatus=DbgBreakPointWithStatus@4
|
||||||
;DbgLoadImageSymbols=DbgLoadImageSymbols@12
|
;DbgLoadImageSymbols=DbgLoadImageSymbols@12
|
||||||
|
|
Loading…
Reference in a new issue