id = (id | ((1 << (IDR_BITS*l))-1)) + 1; 
id = (id | ((1 << (IDR_BITS * l)) - 1)) + 1; 
static int sub_alloc(struct idr *idp, void *ptr, int *starting_id){	int n, m, sh;	struct idr_layer *p, *new;	struct idr_layer *pa[MAX_LEVEL];	int l, id;	long bm;	id = *starting_id;	p = idp->top;	l = idp->layers;	pa[l--] = NULL;	while (1) {		/*		 * We run around this while until we reach the leaf node...		 */		n = (id >> (IDR_BITS*l)) & IDR_MASK;		bm = ~p->bitmap;		m = find_next_bit(&bm, IDR_SIZE, n);		if (m == IDR_SIZE) {			/* no space available go back to previous layer. */			l++;			id = (id | ((1 << (IDR_BITS*l))-1)) + 1;			if (!(p = pa[l])) {				*starting_id = id;				return -2;			}			continue;		}		if (m != n) {			sh = IDR_BITS*l;			id = ((id >> sh) ^ n ^ m) << sh;		}		if ((id >= MAX_ID_BIT) || (id < 0))			return -3;		if (l == 0)			break;		/*		 * Create the layer below if it is missing.		 */		if (!p->ary[m]) {			if (!(new = alloc_layer(idp)))				return -1;			p->ary[m] = new;			p->count++;		}		pa[l--] = p;		p = p->ary[m];	}	/*	 * We have reached the leaf node, plant the	 * users pointer and return the raw id.	 */	p->ary[m] = (struct idr_layer *)ptr;	__set_bit(m, &p->bitmap);	p->count++;	/*	 * If this layer is full mark the bit in the layer above	 * to show that this part of the radix tree is full.	 * This may complete the layer above and require walking	 * up the radix tree.	 */	n = id;	while (p->bitmap == IDR_FULL) {		if (!(p = pa[++l]))			break;		n = n >> IDR_BITS;		__set_bit((n & IDR_MASK), &p->bitmap);	}	return(id);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/e15ae2dd3e436552293e122a5163019e7a0fa450/idr.c/clean/lib/idr.c