unsigned long ring_buffer_free_bytes(struct ring_buffer *buffer) { return buffer->count_bytes - ring_buffer_filled_bytes(buffer); }
int ring_buffer_unused_space(ring_buffer_t *rbuffer) { int used = ring_buffer_filled_bytes(rbuffer); return rbuffer->size - used; }