Block device lowlevel driver descriptor

Each block device driver may define one or more request queues. To keep track of the request queues of each driver, a low-level driver descriptor is used. The descriptor is a data structure of type blk_dev_struct, whose fields are listed in Table 13-9. The descriptors for all the block devices are stored in the blk_dev table, which is indexed by the major number of the block device.

Table 13-9. The fields of a block device driver descriptor

Type

Field

Description

request_queue_t

request_queue

Common request queue (for drivers that do not define per-device queues)

queue proc *

queue

Method returning the address of a per-device queue

void *

data

Data (e.g., minor number) used by queue

If the block device driver has a unique request queue for all physical block devices, its address is stored in the request_queue field. Conversely, if the block device driver maintains several queues, the queue field points to a custom driver method that receives the identifier of the block device file, selects one of the queues according to the value of the data field, then returns the address of the proper request queue.

Was this article helpful?

0 0

Post a comment