table of contents
|PBUF(9)||Kernel Developer's Manual||PBUF(9)|
functions for managing physical buffers
struct buf *
struct buf *
buf *bp, int
These functions are used to allocate and release physical buffers.
The physical buffers are allocated at system startup and are maintained in a separate pool from the main system buffers. They are intended for use by subsystems that cannot or should not be reliant on the main pool of buffers (for example the swap pager). The system allocates between 16 and 256 physical buffers depending on the amount of memory in the system.
Each subsystem that allocates buffers via these
calls is expected to manage its own percentage free counter. If the value is
initialized to -1 the number of buffers available to the subsystem is
limited only by the number of physical buffers available. The number of
buffers is stored in nswbuf which is defined in
<sys/buf.h> and initialized
A recommended initialization value is 1/2 nswbuf.
function returns the first available buffer to the user. If there are no
getpbuf() will sleep waiting for
one to become available. If pfreecnt is zero,
getpbuf() will sleep until it increases.
pfreecnt is decremented prior to returning.
function returns the first available buffer. If there are no buffers
NULL is returned. As well, if
pfreecnt is zero,
returned. pfreecnt is decremented prior to returning a
valid buffer. If
NULL is returned,
pfreecnt is not modified.
function releases the buffer back to the free list. If the buffers
b_rcred or b_wcred structures
NULL, they are freed. See
pfreecnt is incremented prior to returning.
trypbuf() return a pointer to the buffer. In the
also be returned indicating that there are no buffers available.
This manual page was written by Chad David <firstname.lastname@example.org>.
|July 9, 2001||Debian|