April 2012
Intermediate to advanced
352 pages
8h
English
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).
Typically, the stat argument is set to NULL. For more on struct devstat, see the devstat(9) manual page (though it’s somewhat antiquated).
Read now
Unlock full access