Contents

buf_bawrite

Start an asychronous write on a buffer.

Declaration

errno_t buf_bawrite(buf_t bp);

Parameters

  • bp:

    The buffer on which to initiate I/O.

  • throttle:

    If "throttle" is nonzero and more than VNODE_ASYNC_THROTTLE writes are in progress on this file, buf_bawrite() will block until the write count drops below VNODE_ASYNC_THROTTLE. If "throttle" is zero and the write count is high, it will fail with EWOULDBLOCK; the caller can decide whether to make a blocking call or pursue other opportunities.

Return Value

EWOULDBLOCK if write count is high and "throttle" is zero; otherwise, errors from VNOP_BWRITE.

Discussion

Calls VNOP_BWRITE to start the process of propagating an asynchronous write down to the device layer. Callers can wait for writes to complete at their discretion using buf_biowait(). When this function is called, data should already have been written to the buffer's data region.

See Also

Buffers