Section 1.8. A Typical Storage Application IO

   

1.8 A Typical Storage Application I/O

At this point it will be helpful to put everything together and consider a typical storage application in an end-to-end scenario, exploring the various Windows NT entities that we have encountered in this chapter and seeing how they are all used.

The application that we'll consider is a simple one that reads data from a file. The file is on a volume managed by the FtDisk volume manager. Because this configuration is identical to the configuration for Figure 1.7, the device object tree will be similar. Figure 1.8 shows a simplified version of the device object tree for the configuration in Figure 1.7. Again, in the interest of keeping things simple, file system and Cache Manager interactions are ignored; that is, it is assumed that the file is not cached.

Figure 1.8. Read Operation on a Storage Volume

graphics/01fig08.gif

With reference to Figure 1.8, the sequence of operations can be summarized as follows :

Step 1. An application ”for example, a backup application ”issues a read request. After some basic checking, the I/O subsystem forwards the request via an IRP to the relevant file system.

Step 2. The file system determines that it needs to get the data from the volume. The file system driver prepares the IRP with the required parameters, including volume-relative offset from where the read operation must be accomplished and the size of the read operation. The file system driver also specifies an I/O completion routine. The file system driver then sends the IRP to the volume manager.

Step 3. The volume manager translates the volume-relative offset to a disk-relative offset, fills out the IRP appropriately, and then invokes the services of the I/O Manager to send the IRP to the disk class driver.

Step 4. Upon receipt of the IRP, the disk class driver fills in a completion routine in its own IRP stack location. Typically the disk class driver builds another IRP called an associated IRP to accomplish the I/O. The disk class driver fills out the required information in the associated IRP with a SCSI request block (SRB) read request. Note that the SRB is simply the data portion of the IRP, so the basic data structure that is relevant is still an IRP. The disk class driver sends the IRP to the port driver, using the services of the I/O Manager.

Step 5. The SCSIPort driver queues the I/O with some assistance from the miniport driver that controls the SCSI adapter. At this point the IRP is marked as pending and then returned. Typically, the I/O Manager processes the IRP in reverse order of what was just described ”that is, port driver followed by class driver followed by volume manager followed by file system. At each stage, the IRP is marked as pending. For the sake of simplicity, this is not shown in Figure 1.8. At some point the I/O will be sent to the physical device via the PCI bus.

Step 6. At some point the I/O operation completes. Again, in the interest of keeping things simple, it is assumed that the I/O operation was successful. An interrupt is raised to indicate that the I/O operation is complete.

Step 7. The ISR runs and queues a DPC to complete the I/O processing. The DPC is scheduled and runs. The SCSIPort driver marks the IRP as completed and calls the I/O Manager to process the IRP further. The I/O manager processes the IRP and calls the completion routine for the next driver up the stack chain, which is the disk class driver.

Step 8. The I/O Manager calls the disk class driver completion routine. The disk class driver completion routine does the necessary housework and calls the I/O Manager to process the IRP further. The I/O Manager takes processing one more step up the stack chain, in this case to the volume manager FtDisk driver.

Step 9. The FtDisk driver completion routine is invoked, and it does its own processing. When done, it calls the I/O Manager indicating that it is done with the IRP. The I/O Manager walks up the stack and invokes the completion routine for the next driver, which is the file system driver.

Step 10. The file system driver completion routine is called. It does the necessary housekeeping and invokes the I/O Manager. The I/O Manager schedules an APC. The APC is scheduled and copies the necessary data and status code to the backup application user mode buffers. The I/O operation is now complete.


   
Top


Inside Windows Storage
Inside Windows Storage: Server Storage Technologies for Windows 2000, Windows Server 2003 and Beyond
ISBN: 032112698X
EAN: 2147483647
Year: 2003
Pages: 111
Authors: Dilip C. Naik

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net