struct
buf
*
getiobuf(
struct vnode *vp
, bool waitok
)
void
putiobuf(
struct buf *bp
)
)
allocates a
buf
structure.
vp
NULL
.
waitok
getiobuf
can sleep until enough memory is available.
Otherwise, it returns
NULL
immediately if enough memory is not available.
Note that the allocated buffer doesn't belong to buffer cache.
To free it,
putiobuf()
should be used.
brelse(
)
should not be used on it.
putiobuf()
frees
bp
,
which should be a buffer allocated with
getiobuf().