Writing Device Drivers

Buffered I/O Functions

The buffered I/O functions are:

physio()

Perform physical I/O

aphysio()

Perform asynchronous physical I/O

anocancel()

Prevent cancellation of an asynchronous I/O request

minphys()

Limit the physio() buffer size

biowait()

Suspend processes pending completion of block I/O

biodone()

Release the buffer after buffer I/O transfer and notify blocked threads

bioerror()

Indicate the error in a buffer header

geterror()

Return an I/O error

bp_mapin()

Allocate virtual address space

bp_mapout()

Deallocate virtual address space

disksort()

Use a single-direction elevator seek strategy to sort for buffers

getrbuf()

Get a raw buffer header

freerbuf()

Free a raw buffer header

biosize()

Return the size of a buffer structure

bioinit()

Initialize a buffer structure

biofini()

Uninitialize a buffer structure

bioreset()

Reuse a private buffer header after I/O is complete

bioclone()

Clone another buffer

biomodified()

Check whether a buffer is modified

clrbuf()

Erase the contents of a buffer