FreeBSD/usr.sbin/camdd/camdd.c
/*
 * Free a buffer that was written out by the writer thread and returned to
 * the reader thread.
 */
Free a buffer that was written out by the writer thread and returned to
the reader thread.
Free a buffer that was written out by the writer thread and returned to the reader thread .
void
camdd_peer_done(struct camdd_buf *buf)
{
	struct camdd_dev *dev;
	struct camdd_buf_data *data;
	dev = buf->dev;
	if (buf->buf_type != CAMDD_BUF_DATA) {
		errx(1, "%s: should have a data buffer, not an "
		    "indirect buffer", __func__);
	}
	data = &buf->buf_type_spec.data;
	STAILQ_REMOVE(&dev->peer_work_queue, buf, camdd_buf, links);
	dev->num_peer_work_queue--;
	dev->peer_bytes_queued -= (data->fill_len - data->resid);
	if (buf->status == CAMDD_STATUS_EOF)
		dev->flags |= CAMDD_DEV_FLAG_PEER_EOF;
	STAILQ_INSERT_TAIL(&dev->free_queue, buf, links);
}
void camdd_peer_done ( struct camdd_buf * buf ) { struct camdd_dev * dev ; struct camdd_buf_data * data ; dev = buf -> dev ; if ( buf -> buf_type != CAMDD_BUF_DATA ) { errx ( 1 , " " " " , __func__ ) ; } data = & buf -> buf_type_spec . data ; STAILQ_REMOVE ( & dev -> peer_work_queue , buf , camdd_buf , links ) ; dev -> num_peer_work_queue -- ; dev -> peer_bytes_queued -= ( data -> fill_len - data -> resid ) ; if ( buf -> status == CAMDD_STATUS_EOF ) dev -> flags |= CAMDD_DEV_FLAG_PEER_EOF ; STAILQ_INSERT_TAIL ( & dev -> free_queue , buf , links ) ; }
Free a buffer that was written out by the writer thread and returned to
 the reader thread.
Free a buffer that was written out by the writer thread and returned to the reader thread .