Author: pschweitzer
Date: Fri Jun 20 13:40:57 2008
New Revision: 34036
URL:
http://svn.reactos.org/svn/reactos?rev=34036&view=rev
Log:
Miscellaneous NTFS patch:
- Filled FCB structures with more informations
- Added them to linked list
- Set mounted volume to FILE_DEVICE_DISK_FILE_SYSTEM
- Various code cleanup
Modified:
trunk/reactos/drivers/filesystems/ntfs/fcb.c
trunk/reactos/drivers/filesystems/ntfs/fsctl.c
trunk/reactos/drivers/filesystems/ntfs/ntfs.h
Modified: trunk/reactos/drivers/filesystems/ntfs/fcb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/fcb.c [iso-8859-1] Fri Jun 20 13:40:57 2008
@@ -68,7 +68,7 @@
PNTFS_FCB
-NtfsCreateFCB(PCWSTR FileName)
+NtfsCreateFCB(PCWSTR FileName, PNTFS_VCB Vcb)
{
PNTFS_FCB Fcb;
@@ -77,6 +77,8 @@
Fcb->Identifier.Type = NTFS_TYPE_FCB;
Fcb->Identifier.Size = sizeof(NTFS_TYPE_FCB);
+
+ Fcb->Vcb = Vcb;
if (FileName)
{
@@ -92,6 +94,10 @@
}
ExInitializeResourceLite(&Fcb->MainResource);
+
+ Fcb->RFCB.Resource = &(Fcb->MainResource);
+
+ InsertTailList(&(Vcb->FcbListHead), &(Fcb->FcbListEntry));
return(Fcb);
}
@@ -155,7 +161,7 @@
if (Fcb->RefCount <= 0 && !NtfsFCBIsDirectory(Fcb))
{
RemoveEntryList(&Fcb->FcbListEntry);
- CcUninitializeCacheMap (Fcb->FileObject, NULL, NULL);
+ CcUninitializeCacheMap(Fcb->FileObject, NULL, NULL);
NtfsDestroyFCB(Fcb);
}
KeReleaseSpinLock(&Vcb->FcbListLock, oldIrql);
@@ -169,7 +175,7 @@
KIRQL oldIrql;
KeAcquireSpinLock(&Vcb->FcbListLock, &oldIrql);
- Fcb->DevExt = Vcb;
+ Fcb->Vcb = Vcb;
InsertTailList(&Vcb->FcbListHead, &Fcb->FcbListEntry);
KeReleaseSpinLock(&Vcb->FcbListLock, oldIrql);
}
@@ -242,7 +248,7 @@
FileObject->FsContext2 = newCCB;
newCCB->PtrFileObject = FileObject;
Fcb->FileObject = FileObject;
- Fcb->DevExt = Vcb;
+ Fcb->Vcb = Vcb;
Status = STATUS_SUCCESS;
CcInitializeCacheMap(FileObject,
@@ -263,7 +269,7 @@
{
PNTFS_FCB Fcb;
- Fcb = NtfsCreateFCB(L"\\");
+ Fcb = NtfsCreateFCB(L"\\", Vcb);
// memset(Fcb->entry.Filename, ' ', 11);
@@ -371,7 +377,7 @@
wcscat(pathName, entryName);
}
- rcFCB = NtfsCreateFCB(pathName);
+ rcFCB = NtfsCreateFCB(pathName, Vcb);
memcpy(&rcFCB->Entry, Record, sizeof(DIR_RECORD));
Size = rcFCB->Entry.DataLengthL;
@@ -411,7 +417,7 @@
FileObject->FsContext = Fcb;
FileObject->FsContext2 = newCCB;
newCCB->PtrFileObject = FileObject;
- Fcb->DevExt = Vcb;
+ Fcb->Vcb = Vcb;
if (!(Fcb->Flags & FCB_CACHE_INITIALIZED))
{
Modified: trunk/reactos/drivers/filesystems/ntfs/fsctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/fsctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/fsctl.c [iso-8859-1] Fri Jun 20 13:40:57 2008
@@ -190,7 +190,7 @@
DPRINT("BytesPerSector: %lu\n", DiskGeometry.BytesPerSector);
BootSector = ExAllocatePoolWithTag(NonPagedPool,
- DiskGeometry.BytesPerSector, TAG_NTFS);
+ DiskGeometry.BytesPerSector, TAG_NTFS);
if (BootSector == NULL)
{
return(STATUS_INSUFFICIENT_RESOURCES);
@@ -235,7 +235,7 @@
ExFreePool(BootSector);
MftRecord = ExAllocatePoolWithTag(NonPagedPool,
- NtfsInfo->BytesPerFileRecord, TAG_NTFS);
+ NtfsInfo->BytesPerFileRecord, TAG_NTFS);
if (MftRecord == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
@@ -347,8 +347,7 @@
Status = IoCreateDevice(NtfsGlobalData->DriverObject,
sizeof(DEVICE_EXTENSION),
NULL,
- FILE_DEVICE_FILE_SYSTEM,
-// FILE_DEVICE_DISK_FILE_SYSTEM,
+ FILE_DEVICE_DISK_FILE_SYSTEM,
0,
FALSE,
&NewDeviceObject);
@@ -380,7 +379,7 @@
Vcb->StorageDevice);
- Fcb = NtfsCreateFCB(NULL);
+ Fcb = NtfsCreateFCB(NULL, Vcb);
if (Fcb == NULL)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
@@ -407,7 +406,7 @@
Vcb->StreamFileObject->Vpb = Vcb->Vpb;
Ccb->PtrFileObject = Vcb->StreamFileObject;
Fcb->FileObject = Vcb->StreamFileObject;
- Fcb->DevExt = (PDEVICE_EXTENSION)Vcb->StorageDevice;
+ Fcb->Vcb = (PDEVICE_EXTENSION)Vcb->StorageDevice;
Fcb->Flags = FCB_IS_VOLUME_STREAM;
@@ -425,7 +424,6 @@
Fcb);
ExInitializeResourceLite(&Vcb->DirResource);
-// ExInitializeResourceLite(&DeviceExt->FatResource);
KeInitializeSpinLock(&Vcb->FcbListLock);
InitializeListHead(&Vcb->FcbListHead);
Modified: trunk/reactos/drivers/filesystems/ntfs/ntfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/n…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] Fri Jun 20 13:40:57 2008
@@ -130,7 +130,7 @@
SECTION_OBJECT_POINTERS SectionObjectPointers;
PFILE_OBJECT FileObject;
- PDEVICE_EXTENSION DevExt;
+ PNTFS_VCB Vcb;
WCHAR *ObjectName; /* point on filename (250 chars max) in PathName */
WCHAR PathName[MAX_PATH]; /* path+filename 260 max */
@@ -428,7 +428,7 @@
/* fcb.c */
PNTFS_FCB
-NtfsCreateFCB(PCWSTR FileName);
+NtfsCreateFCB(PCWSTR FileName, PNTFS_VCB Vcb);
VOID
NtfsDestroyFCB(PNTFS_FCB Fcb);