bufq
struct ibufqueue *bufq;
if ((bufq = calloc(1, sizeof(*bufq))) == NULL)
ibufq_init(bufq);
return bufq;
ibufq_free(struct ibufqueue *bufq)
if (bufq == NULL)
ibufq_flush(bufq);
free(bufq);
ibufq_pop(struct ibufqueue *bufq)
if ((buf = TAILQ_FIRST(&bufq->bufs)) == NULL)
TAILQ_REMOVE(&bufq->bufs, buf, entry);
bufq->queued--;
ibufq_push(struct ibufqueue *bufq, struct ibuf *buf)
TAILQ_INSERT_TAIL(&bufq->bufs, buf, entry);
bufq->queued++;
ibufq_queuelen(struct ibufqueue *bufq)
return (bufq->queued);
ibufq_flush(struct ibufqueue *bufq)
while ((buf = TAILQ_FIRST(&bufq->bufs)) != NULL) {
TAILQ_REMOVE(&bufq->bufs, buf, entry);
bufq->queued = 0;
ibufq_init(struct ibufqueue *bufq)
TAILQ_INIT(&bufq->bufs);
bufq->queued = 0;
imsg_ibufq_pop(struct ibufqueue *bufq, struct imsg *imsg)
if ((buf = ibufq_pop(bufq)) == NULL)
imsg_ibufq_push(struct ibufqueue *bufq, struct imsg *imsg)
ibufq_push(bufq, imsg->buf);
struct ibuf *ibufq_pop(struct ibufqueue *bufq);
struct bufq sc_bufq;
struct bufq sc_bufq;
struct bufq sc_bufq; /* pending I/O requests */
struct bufq sc_bufq;
struct bufq sc_bufq; /* pending I/O */
bufq_destroy(struct bufq *bq)
SLIST_REMOVE(&bufqs, bq, bufq, bufq_entries);
bufq_queue(struct bufq *bq, struct buf *bp)
bufq_dequeue(struct bufq *bq)
bufq_peek(struct bufq *bq)
bufq_drain(struct bufq *bq)
bufq_wait(struct bufq *bq)
bufq_done(struct bufq *bq, struct buf *bp)
struct bufq *bq;
struct bufq *bq;
SLIST_HEAD(, bufq) bufqs = SLIST_HEAD_INITIALIZER(bufqs);
bufq_init(struct bufq *bq, int type)
struct bufq sc_bufq;
struct bufq sc_bufq;
struct bufq sc_bufq;
struct bufq *b_bq; /* What bufq this buf is on */
SLIST_ENTRY(bufq) bufq_entries;
int bufq_init(struct bufq *, int);
void bufq_destroy(struct bufq *);
void bufq_queue(struct bufq *, struct buf *);
struct buf *bufq_dequeue(struct bufq *);
int bufq_peek(struct bufq *);
void bufq_drain(struct bufq *);
void bufq_wait(struct bufq *);
void bufq_done(struct bufq *, struct buf *);
struct bufq mfs_bufq; /* bufq for MFS I/O */
struct bufq swd_bufq;
io_close_queue(struct ibufqueue *bufq, struct ibuf *b)
ibufq_push(bufq, b);