Author: arty
Date: Sun Oct 19 14:18:04 2008
New Revision: 36834
URL:
http://svn.reactos.org/svn/reactos?rev=36834&view=rev
Log:
Commit up some stuff from cdfs.
Misc merged from trunk and my overhaul of noncached read.
Added:
branches/arty-newcc/drivers/filesystems/cdfs/cdfs.xml
- copied unchanged from r21065, trunk/reactos/drivers/fs/cdfs/cdfs.xml
Modified:
branches/arty-newcc/drivers/filesystems/cdfs/fsctl.c
branches/arty-newcc/drivers/filesystems/cdfs/rw.c
Modified: branches/arty-newcc/drivers/filesystems/cdfs/fsctl.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/drivers/filesystems/…
==============================================================================
--- branches/arty-newcc/drivers/filesystems/cdfs/fsctl.c [iso-8859-1] (original)
+++ branches/arty-newcc/drivers/filesystems/cdfs/fsctl.c [iso-8859-1] Sun Oct 19 14:18:04
2008
@@ -331,8 +331,7 @@
Status = IoCreateDevice(CdfsGlobalData->DriverObject,
sizeof(DEVICE_EXTENSION),
NULL,
- FILE_DEVICE_FILE_SYSTEM,
-// FILE_DEVICE_DISK_FILE_SYSTEM,
+ FILE_DEVICE_CD_ROM_FILE_SYSTEM,
0,
FALSE,
&NewDeviceObject);
Modified: branches/arty-newcc/drivers/filesystems/cdfs/rw.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/drivers/filesystems/…
==============================================================================
--- branches/arty-newcc/drivers/filesystems/cdfs/rw.c [iso-8859-1] (original)
+++ branches/arty-newcc/drivers/filesystems/cdfs/rw.c [iso-8859-1] Sun Oct 19 14:18:04
2008
@@ -76,23 +76,14 @@
{
LARGE_INTEGER FileOffset;
IO_STATUS_BLOCK IoStatus;
- CC_FILE_SIZES FileSizes;
if (ReadOffset + Length > Fcb->Entry.DataLengthL)
Length = Fcb->Entry.DataLengthL - ReadOffset;
if (FileObject->PrivateCacheMap == NULL)
{
- FileSizes.AllocationSize = Fcb->RFCB.AllocationSize;
- FileSizes.FileSize = Fcb->RFCB.FileSize;
- FileSizes.ValidDataLength = Fcb->RFCB.ValidDataLength;
-
- DPRINT("Attach FCB to File: Size %08x%08x\n",
- Fcb->RFCB.ValidDataLength.HighPart,
- Fcb->RFCB.ValidDataLength.LowPart);
-
CcInitializeCacheMap(FileObject,
- &FileSizes,
+ (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
FALSE,
&(CdfsGlobalData->CacheMgrCallbacks),
Fcb);
@@ -112,65 +103,25 @@
if ((ReadOffset % BLOCKSIZE) != 0 || (Length % BLOCKSIZE) != 0)
{
- /* Then we need to do a partial or misaligned read ... */
- PVOID PageBuf = ExAllocatePool(NonPagedPool, BLOCKSIZE);
- PCHAR ReadInPage = (PCHAR)PageBuf + (ReadOffset & (BLOCKSIZE - 1));
- PCHAR TargetRead = (PCHAR)Buffer;
- ULONG ActualReadOffset, EndOfExtent, ReadLen;
+ return STATUS_INVALID_PARAMETER;
+ }
- if (!PageBuf)
- {
- return STATUS_NO_MEMORY;
- }
+ if (ReadOffset + Length > ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE))
+ Length = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE) - ReadOffset;
- ActualReadOffset = ReadOffset & ~(BLOCKSIZE - 1);
- EndOfExtent = ReadOffset + Length;
-
- while (ActualReadOffset < EndOfExtent)
- {
- Status = CdfsReadSectors
- (DeviceExt->StorageDevice,
- Fcb->Entry.ExtentLocationL + (ActualReadOffset / BLOCKSIZE),
- 1,
- PageBuf,
- FALSE);
-
- if (!NT_SUCCESS(Status))
- break;
-
- ReadLen = BLOCKSIZE - (ActualReadOffset & (BLOCKSIZE - 1));
- if (ReadLen > EndOfExtent - ActualReadOffset)
- {
- ReadLen = EndOfExtent - ActualReadOffset;
- }
-
- RtlCopyMemory(TargetRead, ReadInPage, ReadLen);
-
- ActualReadOffset += ReadLen;
- TargetRead += ReadLen;
- }
-
- ExFreePool(PageBuf);
- }
- else
+ Status = CdfsReadSectors(DeviceExt->StorageDevice,
+ Fcb->Entry.ExtentLocationL + (ReadOffset / BLOCKSIZE),
+ Length / BLOCKSIZE,
+ Buffer,
+ FALSE);
+ if (NT_SUCCESS(Status))
{
- if (ReadOffset + Length > ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE))
- Length = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE) - ReadOffset;
-
- Status = CdfsReadSectors(DeviceExt->StorageDevice,
- Fcb->Entry.ExtentLocationL + (ReadOffset / BLOCKSIZE),
- Length / BLOCKSIZE,
- Buffer,
- FALSE);
- if (NT_SUCCESS(Status))
- {
- *LengthRead = Length;
- if (Length + ReadOffset > Fcb->Entry.DataLengthL)
- {
- memset(Buffer + Fcb->Entry.DataLengthL - ReadOffset,
- 0,
- Length + ReadOffset - Fcb->Entry.DataLengthL);
- }
+ *LengthRead = Length;
+ if (Length + ReadOffset > Fcb->Entry.DataLengthL)
+ {
+ memset(Buffer + Fcb->Entry.DataLengthL - ReadOffset,
+ 0,
+ Length + ReadOffset - Fcb->Entry.DataLengthL);
}
}