/* NOTE. Care should be taken that the channel isn't actually being used by anything when this call is made.  */
void relay_reset(struct rchan *chan)
/* NOTE. Care should be taken that the channel isn't actually being used by anything when this call is made.  */
void relay_reset(struct rchan *chan)
{
	unsigned int i;
	if (!chan)
		return;
	if (chan->is_global && chan->buf[0]) {
		__relay_reset(chan->buf[0], 0);
		return;
	}
	mutex_lock(&relay_channels_mutex);
	for_each_possible_cpu(i)
		if (chan->buf[i])
			__relay_reset(chan->buf[i], 0);
	mutex_unlock(&relay_channels_mutex);
}