size = tnode_child_length(left); for(j = 0; j < size; j++) { put_child(t, left, j, inode->child[j]); put_child(t, right, j, inode->child[j + size]); } put_child(t, tn, 2*i, resize(t, left)); put_child(t, tn, 2*i+1, resize(t, right)); 
size = tnode_child_length(left); for (j = 0; j < size; j++) { put_child(t, left, j, inode->child[j]); put_child(t, right, j, inode->child[j + size]); } put_child(t, tn, 2*i, resize(t, left)); put_child(t, tn, 2*i+1, resize(t, right)); 
static struct tnode *inflate(struct trie *t, struct tnode *tn, int *err){	struct tnode *inode;	struct tnode *oldtnode = tn;	int olen = tnode_child_length(tn);	int i;  	if (trie_debug)		printk("In inflate\n");	tn = tnode_new(oldtnode->key, oldtnode->pos, oldtnode->bits + 1);	if (!tn) {		*err = -ENOMEM;		return oldtnode;	}	/*	 * Preallocate and store tnodes before the actual work so we	 * don't get into an inconsistent state if memory allocation	 * fails. In case of failure we return the oldnode and  inflate	 * of tnode is ignored.	 */			for(i = 0; i < olen; i++) {		struct tnode *inode = (struct tnode *) tnode_get_child(oldtnode, i);		if (inode &&		    IS_TNODE(inode) &&		    inode->pos == oldtnode->pos + oldtnode->bits &&		    inode->bits > 1) {			struct tnode *left, *right;			t_key m = TKEY_GET_MASK(inode->pos, 1);			left = tnode_new(inode->key&(~m), inode->pos + 1,					 inode->bits - 1);			if (!left) {				*err = -ENOMEM;				break;			}					right = tnode_new(inode->key|m, inode->pos + 1,					  inode->bits - 1);			if (!right) {				*err = -ENOMEM;				break;			}			put_child(t, tn, 2*i, (struct node *) left);			put_child(t, tn, 2*i+1, (struct node *) right);		}	}	if (*err) {		int size = tnode_child_length(tn);		int j;		for(j = 0; j < size; j++)			if (tn->child[j])				tnode_free((struct tnode *)tn->child[j]);		tnode_free(tn);			*err = -ENOMEM;		return oldtnode;	}	for(i = 0; i < olen; i++) {		struct node *node = tnode_get_child(oldtnode, i);		/* An empty child */		if (node == NULL)			continue;		/* A leaf or an internal node with skipped bits */		if (IS_LEAF(node) || ((struct tnode *) node)->pos >		   tn->pos + tn->bits - 1) {			if (tkey_extract_bits(node->key, oldtnode->pos + oldtnode->bits,					     1) == 0)				put_child(t, tn, 2*i, node);			else				put_child(t, tn, 2*i+1, node);			continue;		}		/* An internal node with two children */		inode = (struct tnode *) node;		if (inode->bits == 1) {			put_child(t, tn, 2*i, inode->child[0]);			put_child(t, tn, 2*i+1, inode->child[1]);			tnode_free(inode);		}			/* An internal node with more than two children */		else {			struct tnode *left, *right;			int size, j;			/* We will replace this node 'inode' with two new			 * ones, 'left' and 'right', each with half of the			 * original children. The two new nodes will have			 * a position one bit further down the key and this			 * means that the "significant" part of their keys			 * (see the discussion near the top of this file)			 * will differ by one bit, which will be "0" in			 * left's key and "1" in right's key. Since we are			 * moving the key position by one step, the bit that			 * we are moving away from - the bit at position			 * (inode->pos) - is the one that will differ between			 * left and right. So... we synthesize that bit in the			 * two  new keys.			 * The mask 'm' below will be a single "one" bit at			 * the position (inode->pos)			 */			/* Use the old key, but set the new significant			 *   bit to zero.			 */			left = (struct tnode *) tnode_get_child(tn, 2*i);			put_child(t, tn, 2*i, NULL);			if (!left)				BUG();			right = (struct tnode *) tnode_get_child(tn, 2*i+1);			put_child(t, tn, 2*i+1, NULL);			if (!right)				BUG();			size = tnode_child_length(left);			for(j = 0; j < size; j++) {				put_child(t, left, j, inode->child[j]);				put_child(t, right, j, inode->child[j + size]);			}			put_child(t, tn, 2*i, resize(t, left));			put_child(t, tn, 2*i+1, resize(t, right));			tnode_free(inode);		}	}	tnode_free(oldtnode);	return tn;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/91b9a277fc4d207249e459a455abf804ebb5499d/fib_trie.c/buggy/net/ipv4/fib_trie.c