/* This also stores the host for indexing by minor, which is somewhat dirty.  */
static int ub_id_get(void)
/* This also stores the host for indexing by minor, which is somewhat dirty.  */
static int ub_id_get(void)
{
	unsigned long flags;
	int i;
	spin_lock_irqsave(&ub_lock, flags);
	for (i = 0; i < UB_MAX_HOSTS; i++) {
		if (ub_hostv[i] == 0) {
			ub_hostv[i] = 1;
			spin_unlock_irqrestore(&ub_lock, flags);
			return i;
		}
	}
	spin_unlock_irqrestore(&ub_lock, flags);
	return -1;
}