/* NOTE. Kernel clients don't need to call this function if the channel mode is 'overwrite'.  */
void relay_subbufs_consumed(struct rchan *chan, unsigned int cpu, size_t subbufs_consumed)
/* NOTE. Kernel clients don't need to call this function if the channel mode is 'overwrite'.  */
void relay_subbufs_consumed(struct rchan *chan, unsigned int cpu, size_t subbufs_consumed)
{
	struct rchan_buf *buf;
	if (!chan)
		return;
	if (cpu >= NR_CPUS || !chan->buf[cpu] ||
					subbufs_consumed > chan->n_subbufs)
		return;
	buf = chan->buf[cpu];
	if (subbufs_consumed > buf->subbufs_produced - buf->subbufs_consumed)
		buf->subbufs_consumed = buf->subbufs_produced;
	else
		buf->subbufs_consumed += subbufs_consumed;
}