Contents

buf_unmap

Release mappings for buffer data.

Declaration

errno_t buf_unmap(buf_t bp);

Parameters

  • bp:

    Buffer whose mapping to find or create.

  • io_addr:

    Destination for mapping address.

Return Value

0 for success, EINVAL if unable to unmap buffer.

Discussion

For buffers created through buf_getblk() (i.e. traditional buffer cache usage), buf_unmap() does nothing; buf_brelse() will take care of unmapping. For a B_CLUSTER buffer, i.e. an iobuf whose upl state is managed manually, there are two possibilities. If the buffer was created with an underlying "real" buffer through cluster_bp(), buf_unmap() does nothing; buf_brelse() on the underlying buffer will tear down the mapping. Otherwise, the buffer was created with buf_alloc() and buf_setupl() was subsequently called; buf_map() created the mapping. In this case, buf_unmap() will unmap the buffer.

See Also

Buffers