Block I/O Completion Routines

As seen in the previous section, after processing a block-centric I/O request, you must inform the kernel with:

#include <sys/bio.h>

void
biodone(struct bio *bp);

void
biofinish(struct bio *bp, struct devstat *stat, int error);

The biodone function tells the kernel that the block-centric I/O request bp has been serviced successfully.

The biofinish function is identical to biodone, except that it sets bp to return the error code error (that is to say, biofinish can tell the kernel that bp was invalid, successful, or unsuccessful).

Note

Typically, the stat argument is set to NULL. For more on struct devstat, see the devstat(9) manual page (though it’s somewhat antiquated).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.11.28