Adding Disks and Partitions to the System

After having introduced numerous data structures that build up the block layer, everything is set to examine in more detail how generic hard disks are added to the system. As mentioned above, add_disk is provided for this purpose. A discussion of the implementation follows an examination of how partitions are added to the kernel's data structures using add_partition.

Table 6-2: Hardware Characteristics of a Request Queue.

Element

Meaning

max_sectors

Specifies the maximum number of sectors that the device can process in a single request; the sector size of the specific device (hardsect_size) is used as the size unit.

max_segment_size

Maximum segment size (in bytes) for a single request.

max_phys_segments

Specifies the maximum number of non-continuous segments for scatter-gather requests used to transport non-contiguous data.

max_hw_segments

Same as max_phys_segments but takes into account any remappings that may be made by a (possible) I/O MMU. The constant specifies the maximum number of address/length pairs that the driver can pass to the device.

hardsect_size

Specifies the physical sector size with which the device operates. This value is almost always 512; only a few very new devices use different settings.

Continue reading here: Adding Partitions

Was this article helpful?

0 0