buf_brelse
Release any claim to a buffer, sending it back to free lists.
Declaration
void buf_brelse(buf_t bp);Parameters
- bp:
The buffer to release. @retrn void.
Discussion
buf_brelse() cleans up buffer state and releases a buffer to the free lists. If the buffer is not marked invalid and its pages are dirty (e.g. a delayed write was made), its data will be commited to backing store. If it is marked invalid, its data will be discarded completely. A valid, cacheable buffer will be put on a list and kept in the buffer hash so it can be found again; otherwise, it will be dissociated from its vnode and treated as empty. Which list a valid buffer is placed on depends on the use of buf_markaged(), whether it is metadata, and the B_LOCKED flag. A B_LOCKED buffer will not be available for reuse by other files, though its data may be paged out. Note that buf_brelse() is intended for use with traditionally allocated buffers.
See Also
Buffers
buf_allocbuf_attrbuf_bawritebuf_bdwritebuf_biodonebuf_biowaitbuf_blknobuf_breadbuf_breadnbuf_bwritebuf_callbackbuf_clearbuf_clear_redundancy_flagsbuf_clearflagsbuf_clonebuf_countbuf_create_shadowbuf_dataptrbuf_devicebuf_dirtyendbuf_dirtyoffbuf_drvdatabuf_errorbuf_flagsbuf_flushdirtyblksbuf_freebuf_fromcachebuf_fsprivatebuf_fuabuf_getblkbuf_geteblkbuf_invalblknobuf_invalidateblksbuf_iteratebuf_lblknobuf_mapbuf_markagedbuf_markcleanbuf_markdelayedbuf_markeintrbuf_markfuabuf_markinvalidbuf_markstaticbuf_meta_breadbuf_meta_breadnbuf_procbuf_rcredbuf_redundancy_flagsbuf_resetbuf_residbuf_set_redundancy_flagsbuf_setblknobuf_setcallbackbuf_setcountbuf_setdataptrbuf_setdevicebuf_setdirtyendbuf_setdirtyoffbuf_setdrvdatabuf_seterrorbuf_setflagsbuf_setfsprivatebuf_setlblknobuf_setresidbuf_setsizebuf_setuplbuf_setvnodebuf_shadowbuf_sizebuf_staticbuf_strategybuf_unmapbuf_uplbuf_uploffsetbuf_validbuf_vnodebuf_wcredbufattr_ioscheduledbufattr_markioscheduled