buf_strategy
Pass an I/O request for a buffer down to the device layer.
Declaration
errno_t buf_strategy(vnode_t devvp, void *ap);Parameters
- devvp:
Device on which to perform I/O
- ap:
vnop_strategy_args structure (most importantly, a buffer).
Return Value
0 for success, or errors from filesystem or device layers.
Discussion
This is one of the most important routines in the buffer cache layer. For buffers obtained through buf_getblk, it handles finding physical block numbers for the I/O (with VNOP_BLKTOOFF and VNOP_BLOCKMAP), packaging the I/O into page-sized chunks, and initiating I/O on the disk by calling the device's strategy routine. If a buffer's UPL has been set manually with buf_setupl(), it assumes that the request is already correctly configured with a block number and a size divisible by page size and will just call directly to the device.
See Also
Buffers
buf_allocbuf_attrbuf_bawritebuf_bdwritebuf_biodonebuf_biowaitbuf_blknobuf_breadbuf_breadnbuf_brelsebuf_bwritebuf_callbackbuf_clearbuf_clear_redundancy_flagsbuf_clearflagsbuf_clonebuf_countbuf_create_shadowbuf_dataptrbuf_devicebuf_dirtyendbuf_dirtyoffbuf_drvdatabuf_errorbuf_flagsbuf_flushdirtyblksbuf_freebuf_fromcachebuf_fsprivatebuf_fuabuf_getblkbuf_geteblkbuf_invalblknobuf_invalidateblksbuf_iteratebuf_lblknobuf_mapbuf_markagedbuf_markcleanbuf_markdelayedbuf_markeintrbuf_markfuabuf_markinvalidbuf_markstaticbuf_meta_breadbuf_meta_breadnbuf_procbuf_rcredbuf_redundancy_flagsbuf_resetbuf_residbuf_set_redundancy_flagsbuf_setblknobuf_setcallbackbuf_setcountbuf_setdataptrbuf_setdevicebuf_setdirtyendbuf_setdirtyoffbuf_setdrvdatabuf_seterrorbuf_setflagsbuf_setfsprivatebuf_setlblknobuf_setresidbuf_setsizebuf_setuplbuf_setvnodebuf_shadowbuf_sizebuf_staticbuf_unmapbuf_uplbuf_uploffsetbuf_validbuf_vnodebuf_wcredbufattr_ioscheduledbufattr_markioscheduled