April 2012
Intermediate to advanced
352 pages
8h
English
A bio structure represents a block-centric I/O request. Loosely speaking, when the kernel needs to transfer some data to or from a storage device, it puts together a bio structure to describe that operation; then it passes that structure to the appropriate driver.
struct bio is defined in the <sys/bio.h> header as follows:
struct bio { uint8_t bio_cmd; /* I/O operation. */ uint8_t bio_flags; /* General flags. */ uint8_t bio_cflags; /* Private use by the consumer. */ uint8_t bio_pflags; /* Private use by the provider. */ struct cdev *bio_dev; /* Device to perform I/O on. */ struct disk *bio_disk; /* Disk structure. */ off_t bio_offset; /* Requested position in file. */ long bio_bcount; /* Number of (valid) bytes. */ caddr_t bio_data; ...Read now
Unlock full access