/* Returns 1 if the buffer is full, 0 otherwise.  */
int relay_buf_full(struct rchan_buf *buf)
/* Returns 1 if the buffer is full, 0 otherwise.  */
int relay_buf_full(struct rchan_buf *buf)
{
	size_t ready = buf->subbufs_produced - buf->subbufs_consumed;
	return (ready >= buf->chan->n_subbufs) ? 1 : 0;
}