release a block buffer
void brelse(struct buf bp);
The brelse function is called by a block device driver to
release a block buffer to the free pool of buffers. The contents of
the buffer are lost and the driver is not allowed to make any
further reference to it. This routine is called by
at the completion of a block I/O request if the bit
B_ASYNC is set in
The bp argument is a pointer to the buffer header relating
to the buffer to be released.
When the routine is first called, the buffer header is checked to
see if an error has occured on the request (
has B_ERROR set). If so, these additional actions occur:
The B_STALE and B_AGE flags are set in
The B_ERROR and B_DELWRI flags are removed from
bp->b_error field is set to zero.
All processes associated with bp that are sleeping waiting
for the header of this buffer or a free buffer are awakened. On
completion of brelse,
b_proc is set to zero to
release the process's ownership of the buffer.
brelse does not return a value.
Context and synchronization
1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp block drivers.
Differences between versions
``ODDI driver interface version for SCO OpenServer 5'' in HDK Technical Reference
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005