GETEBLK(K) UNIX System V GETEBLK(K)
Name
geteblk, getablk - gets a buffer from the block buffer pool
Syntax
struct buf *
getablk()
struct buf *
geteblk()
Description
The geteblk routine acquires a free buffer from the block
buffer pool. The pointer returned by this routine addresses
a buffer that can be used as required. The buffer can
subsequently be returned to the buffer pool by calling
brelse(K) or iodone(K).
getablk calls geteblk directly. getablk is provided for
compatibility only and may go away in future releases.
OR the b_flags field of the buf structure with B_WANTED if
geteblk should sleep if a buffer is not available. When
sleeping is requested, it is performed below PZERO and is
not affected by signals.
When a buffer is allocated, geteblk ORs b_flags with B_BUSY
and B_AGE, b_back and b_forw are set to the same buffer
pointer that is returned, b_dev is set to NODEV, and
b_bcount is set to SBUFSIZE. SBUFSIZE is defined in
sys/fs/s5param.h and varies in size according to the file
system size.
Return Value
This routine returns a struct buf * that addresses the
allocated buffer.
Notes
This routine may be used only by block device drivers. This
routine calls spl0(K) to enable all interrupts. This may
change previously set interrupt levels.
See Also
brelse(K), iodone(K)
(printed 7/6/89)