mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 04:45:45 +00:00
- 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.
svn path=/trunk/; revision=22766
This commit is contained in:
parent
ff429eb9f3
commit
130980ccde
1 changed files with 20 additions and 21 deletions
|
@ -316,10 +316,9 @@ IopMountVolume(IN PDEVICE_OBJECT DeviceObject,
|
|||
PIRP Irp;
|
||||
PIO_STACK_LOCATION StackPtr;
|
||||
PLIST_ENTRY FsList, ListEntry;
|
||||
PDEVICE_OBJECT ParentFsDeviceObject;
|
||||
PDEVICE_OBJECT AttachedDeviceObject = DeviceObject;
|
||||
PDEVICE_OBJECT FileSystemDeviceObject;
|
||||
LIST_ENTRY LocalList;
|
||||
PDEVICE_OBJECT AttachedDeviceObject = DeviceObject;
|
||||
PDEVICE_OBJECT FileSystemDeviceObject, ParentFsDeviceObject;
|
||||
ULONG FsStackOverhead;
|
||||
PAGED_CODE();
|
||||
|
||||
|
@ -343,24 +342,6 @@ IopMountVolume(IN PDEVICE_OBJECT DeviceObject,
|
|||
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)))
|
||||
{
|
||||
|
@ -377,6 +358,24 @@ IopMountVolume(IN PDEVICE_OBJECT DeviceObject,
|
|||
/* 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;
|
||||
ListEntry = FsList->Flink;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue