Block device drivers are the lowest component of the Linux block subsystem. They get requests from I/O scheduler, and do whatever is required to process them.
Block device drivers are, of course, integrated within the device
driver model described in the section "The Device Driver Model" in
Chapter 13. Therefore, each
of them refers to a
descriptor; moreover, each disk handled by the driver is associated with
device descriptor. These
descriptors, however, are rather generic: the block I/O subsystem must
store additional information for each block device in the system.
A block device driver may handle several block devices. For instance, the IDE device driver can handle several IDE disks, each of which is a separate block device. Furthermore, each disk is usually partitioned, and each partition can be seen as a logical block device. Clearly, the block device driver must take care of all VFS system calls issued on the block device files associated with the corresponding block devices.
Each block device is represented by a
block_device descriptor, whose fields are
listed in Table
Table 14-9. The fields of the block device descriptor
Major and minor numbers of the block device
Pointer to the inode of the file associated with the block device in the bdev filesystem
Counter of how many times the block device has been opened