April 2012
Intermediate to advanced
352 pages
8h
English

In FreeBSD, storage drivers provide access to devices that transfer randomly accessible data in blocks (such as disk drives, flash memory, and so on). A block is a fixed-size chunk of data (Corbet et al., 2005). In this chapter I’ll discuss how to manage devices that employ block-centric I/O. To that end, some familiarity with disk and bio structures is needed, so that is where we’ll start.
A disk structure is the kernel’s representation of an individual disk-like storage device. It is defined in the <geom/geom_disk.h> header as follows:
struct disk { /* GEOM Private Data */ struct g_geom *d_geom; struct ...