Writing Device Drivers

Block Driver Additions to the State Structure

This chapter adds the following fields to the state structure. See "Software State Structure" for more information.

	int			nblocks;				/* size of device */
 	int			open;				/* flag indicating device is open */
 	int			nlayered;				/* count of layered opens */
 	struct buf *list_head;							/* head of transfer request list */
 	struct buf *list_tail;							/* tail of transfer request list */