BIOFINI(9F) Kernel Functions for Drivers BIOFINI(9F)
biofini - uninitialize a buffer structure
#include <sys/ddi.h>
#include <sys/sunddi.h>
void biofini(struct buf *bp);
illumos DDI specific (illumos DDI).
bp
Pointer to the buffer header structure.
The biofini() function uninitializes a buf(9S) structure. If a buffer
structure has been allocated and initialized using kmem_alloc(9F) and
bioinit(9F) it needs to be uninitialized using biofini() before
calling kmem_free(9F). It is not necessary to call biofini() before
freeing a buffer structure using freerbuf(9F) because freerbuf() will
call biofini() directly.
The biofini() function can be called from any context.
struct buf *bp = kmem_alloc(biosize(), KM_SLEEP);
bioinit(bp);
/* use buffer */
biofini(bp);
kmem_free(bp, biosize());
bioinit(9F), bioreset(9F), biosize(9F), freerbuf(9F), kmem_alloc(9F),
kmem_free(9F), buf(9S)
Writing Device Drivers
November 20, 1996 BIOFINI(9F)
NAME
biofini - uninitialize a buffer structure
SYNOPSIS
#include <sys/ddi.h>
#include <sys/sunddi.h>
void biofini(struct buf *bp);
INTERFACE LEVEL
illumos DDI specific (illumos DDI).
PARAMETERS
bp
Pointer to the buffer header structure.
DESCRIPTION
The biofini() function uninitializes a buf(9S) structure. If a buffer
structure has been allocated and initialized using kmem_alloc(9F) and
bioinit(9F) it needs to be uninitialized using biofini() before
calling kmem_free(9F). It is not necessary to call biofini() before
freeing a buffer structure using freerbuf(9F) because freerbuf() will
call biofini() directly.
CONTEXT
The biofini() function can be called from any context.
EXAMPLES
Example 1: Using biofini()
struct buf *bp = kmem_alloc(biosize(), KM_SLEEP);
bioinit(bp);
/* use buffer */
biofini(bp);
kmem_free(bp, biosize());
SEE ALSO
bioinit(9F), bioreset(9F), biosize(9F), freerbuf(9F), kmem_alloc(9F),
kmem_free(9F), buf(9S)
Writing Device Drivers
November 20, 1996 BIOFINI(9F)