Skip to Content
FreeBSD Device Drivers
book

FreeBSD Device Drivers

by Joseph Kong
April 2012
Intermediate to advanced
352 pages
8h
English
No Starch Press
Content preview from FreeBSD Device Drivers

Block I/O Queues

All storage drivers maintain a block I/O queue to house any pending block-centric I/O requests. Generally speaking, these requests are stored in increasing or decreasing device-offset order so that when they are processed, the disk head will move in a single direction (instead of bouncing around) to maximize performance.

The FreeBSD kernel provides the following functions for working with block I/O queues:

#include <sys/bio.h> void bioq_init(struct bio_queue_head *head); void bioq_disksort(struct bio_queue_head *head, struct bio *bp); struct bio * bioq_first(struct bio_queue_head *head); struct bio * bioq_takefirst(struct bio_queue_head *head); void bioq_insert_head(struct bio_queue_head *head, struct bio *bp); void bioq_insert_tail(struct ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Embedded Linux

Embedded Linux

John Lombardo
Essential Linux Device Drivers

Essential Linux Device Drivers

Sreekrishnan Venkateswaran

Publisher Resources

ISBN: 9781457166716Errata