Author: ion
Date: Sun Jul 2 10:28:29 2006
New Revision: 22767
URL: http://svn.reactos.org/svn/reactos?rev=22767&view=rev
Log:
- Move IoGetBaseFileSystemDeviceObject to device.c and make it check for FO_DIRECT_DEVICE_OPEN, which it wasn't before (and also code it in a less confusing way like the other IoGetXxxDeviceObject APIs)
- Mask out the DO_VERIFY_VOLUME flag when mounting a device.
Modified:
trunk/reactos/ntoskrnl/io/iomgr/device.c
trunk/reactos/ntoskrnl/io/iomgr/volume.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/device.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/device.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/device.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/device.c Sun Jul 2 10:28:29 2006
@@ -1164,6 +1164,41 @@
}
/* Return the DO we found */
+ return DeviceObject;
+}
+
+/*
+ * @implemented
+ */
+PDEVICE_OBJECT
+NTAPI
+IoGetBaseFileSystemDeviceObject(IN PFILE_OBJECT FileObject)
+{
+ PDEVICE_OBJECT DeviceObject;
+
+ /*
+ * If the FILE_OBJECT's VPB is defined,
+ * get the device from it.
+ */
+ if ((FileObject->Vpb) && (FileObject->Vpb->DeviceObject))
+ {
+ /* Use the VPB's Device Object's */
+ DeviceObject = FileObject->Vpb->DeviceObject;
+ }
+ else if (!(FileObject->Flags & FO_DIRECT_DEVICE_OPEN) &&
+ (FileObject->DeviceObject->Vpb) &&
+ (FileObject->DeviceObject->Vpb->DeviceObject))
+ {
+ /* Use the VPB's File System Object */
+ DeviceObject = FileObject->DeviceObject->Vpb->DeviceObject;
+ }
+ else
+ {
+ /* Use the FO's Device Object */
+ DeviceObject = FileObject->DeviceObject;
+ }
+
+ /* Return the device object we found */
return DeviceObject;
}
Modified: trunk/reactos/ntoskrnl/io/iomgr/volume.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/volume.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/volume.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/volume.c Sun Jul 2 10:28:29 2006
@@ -35,7 +35,8 @@
NTAPI
IoInitVpbImplementation(VOID)
{
- KeInitializeSpinLock(&IoVpbLock);
+ /* Just initialize the VPB Lock */
+ KeInitializeSpinLock(&IoVpbLock);
}
VOID
@@ -348,7 +349,8 @@
/* Initialize the event to wait on */
KeInitializeEvent(&Event, NotificationEvent, FALSE);
- /* Get the actual device to mount */
+ /* Remove the verify flag and get the actual device to mount */
+ DeviceObject->Flags &= ~DO_VERIFY_VOLUME;
while (AttachedDeviceObject->AttachedDevice)
{
/* Get the next one */
@@ -782,48 +784,6 @@
/*
* @implemented
*/
-PDEVICE_OBJECT
-NTAPI
-IoGetBaseFileSystemDeviceObject(IN PFILE_OBJECT FileObject)
-{
- PDEVICE_OBJECT DeviceObject = NULL;
- PVPB Vpb = NULL;
-
- /*
- * If the FILE_OBJECT's VPB is defined,
- * get the device from it.
- */
- if (NULL != (Vpb = FileObject->Vpb))
- {
- if (NULL != (DeviceObject = Vpb->DeviceObject))
- {
- /* Vpb->DeviceObject DEFINED! */
- return DeviceObject;
- }
- }
-
- /*
- * If that failed, try the VPB
- * in the FILE_OBJECT's DeviceObject.
- */
- DeviceObject = FileObject->DeviceObject;
- if (NULL == (Vpb = DeviceObject->Vpb))
- {
- /* DeviceObject->Vpb UNDEFINED! */
- return DeviceObject;
- }
-
- /*
- * If that pointer to the VPB is again
- * undefined, return directly the
- * device object from the FILE_OBJECT.
- */
- return ((NULL == Vpb->DeviceObject) ? DeviceObject : Vpb->DeviceObject);
-}
-
-/*
- * @implemented
- */
NTSTATUS
NTAPI
IoRegisterFsRegistrationChange(IN PDRIVER_OBJECT DriverObject,
Author: ion
Date: Sun Jul 2 10:18:55 2006
New Revision: 22766
URL: http://svn.reactos.org/svn/reactos?rev=22766&view=rev
Log:
- Small optimization: don't bother to get the File System Listhead we'll parse if we're going to fail because of wrong VPB flags later... get the list only after we're sure we need it.
Modified:
trunk/reactos/ntoskrnl/io/iomgr/volume.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/volume.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/volume.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/volume.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/volume.c Sun Jul 2 10:18:55 2006
@@ -316,10 +316,9 @@
PIRP Irp;
PIO_STACK_LOCATION StackPtr;
PLIST_ENTRY FsList, ListEntry;
- PDEVICE_OBJECT ParentFsDeviceObject;
+ LIST_ENTRY LocalList;
PDEVICE_OBJECT AttachedDeviceObject = DeviceObject;
- PDEVICE_OBJECT FileSystemDeviceObject;
- LIST_ENTRY LocalList;
+ PDEVICE_OBJECT FileSystemDeviceObject, ParentFsDeviceObject;
ULONG FsStackOverhead;
PAGED_CODE();
@@ -343,24 +342,6 @@
KeEnterCriticalRegion();
ExAcquireResourceSharedLite(&FileSystemListLock, TRUE);
- /* For a mount operation, this can only be a Disk, CD-ROM or tape */
- if ((DeviceObject->DeviceType == FILE_DEVICE_DISK) ||
- (DeviceObject->DeviceType == FILE_DEVICE_VIRTUAL_DISK))
- {
- /* Use the disk list */
- FsList = &IopDiskFsListHead;
- }
- else if (DeviceObject->DeviceType == FILE_DEVICE_CD_ROM)
- {
- /* Use the CD-ROM list */
- FsList = &IopCdRomFsListHead;
- }
- else
- {
- /* It's gotta be a tape... */
- FsList = &IopTapeFsListHead;
- }
-
/* Make sure we weren't already mounted */
if (!(DeviceObject->Vpb->Flags & (VPB_MOUNTED | VPB_REMOVE_PENDING)))
{
@@ -376,6 +357,24 @@
/* Reference it */
ObReferenceObject(AttachedDeviceObject);
+
+ /* For a mount operation, this can only be a Disk, CD-ROM or tape */
+ if ((DeviceObject->DeviceType == FILE_DEVICE_DISK) ||
+ (DeviceObject->DeviceType == FILE_DEVICE_VIRTUAL_DISK))
+ {
+ /* Use the disk list */
+ FsList = &IopDiskFsListHead;
+ }
+ else if (DeviceObject->DeviceType == FILE_DEVICE_CD_ROM)
+ {
+ /* Use the CD-ROM list */
+ FsList = &IopCdRomFsListHead;
+ }
+ else
+ {
+ /* It's gotta be a tape... */
+ FsList = &IopTapeFsListHead;
+ }
/* Now loop the fs list until one of the file systems accepts us */
Status = STATUS_UNSUCCESSFUL;