Contents

buf_alloc

Allocate an uninitialized buffer.

Declaration

buf_t buf_alloc(vnode_t vp);

Parameters

  • vp:

    vnode to associate with the buffer: optionally NULL. If vp is a device file, then the buffer's associated device will be set. If vp is NULL, it can be set later with buf_setvnode().

Return Value

New buffer.

Discussion

A buffer returned by buf_alloc() is marked as busy and as an iobuf; it has no storage set up and must be set up using buf_setdataptr() or buf_setupl()/buf_map().

See Also

Buffers