int
bufq_alloc(struct bufq_state **bufq, const char *strategy, int flags)
void
bufq_drain(struct bufq_state *bufq)
void
bufq_free(struct bufq_state *bufq)
const char *
bufq_getstrategyname(struct bufq_state *bufq)
void
bufq_move(struct bufq_state *dst, struct bufq_state *src)
void
BUFQ_PUT(struct bufq_state *bufq, struct buf *bp)
struct buf *
BUFQ_GET(struct bufq_state *bufq)
struct buf *
BUFQ_PEEK(struct bufq_state *bufq)
struct buf *
BUFQ_CANCEL(struct bufq_state *bufq, struct buf *bp)
The primary data type for using the operations is the bufq_state structure, which is opaque for users.
bufq, strategy, flags)
The argument
strategy
specifies a buffer queue strategy to be used for this buffer queue.
The following special values can be used:
BUFQ_STRAT_ANY)
select a strategy.
BUFQ_DISK_DEFAULT_STRAT)
select a strategy, assuming it will be used for a normal disk device.
Valid bits for the
flags
are:
BUFQ_SORT_RAWBLOCKBUFQ_SORT_CYLINDERBUFQ_EXACTstrategy
is not available.
In that case,
bufq_alloc
returns
ENOENT.
If this flag is not specified,
bufq_alloc()
will silently use one of available strategies.
bufq)bufq)bufq)dst, src)src
to the buffer queue
dst.
bufq, bp)bp
in the queue.
bufq)NULL
if the queue is empty.
bufq)),
BUFQ_PUT(),
or
bufq_drain()
is called.
Returns
NULL
if the queue is empty.
bufq, bp)bp
issued earlier on the queue.
Returns
NULL
if the element can not be found on the queue or
bp
if it has been found and removed.
sys/kern/subr_bufq.c.