struct trie_use_stats stats;
#endif
int size;
- unsigned int revision;
};
static void put_child(struct trie *t, struct tnode *tn, int i, struct node *n);
if (!li) {
*err = -ENOMEM;
- goto err;
+ goto done;
}
fa_head = &li->falh;
if (!l) {
*err = -ENOMEM;
- goto err;
+ goto done;
}
l->key = key;
if (!li) {
tnode_free((struct tnode *) l);
*err = -ENOMEM;
- goto err;
+ goto done;
}
fa_head = &li->falh;
free_leaf_info(li);
tnode_free((struct tnode *) l);
*err = -ENOMEM;
- goto err;
+ goto done;
}
node_set_parent((struct node *)tn, tp);
rcu_assign_pointer(t->trie, trie_rebalance(t, tp));
done:
- t->revision++;
-err:
return fa_head;
}
* Remove the leaf and rebalance the tree
*/
- t->revision++;
t->size--;
tp = node_parent(n);
struct leaf *ll = NULL, *l = NULL;
int found = 0, h;
- t->revision++;
-
for (h = 0; (l = nextleaf(t, l)) != NULL; h++) {
found += trie_flush_leaf(t, l);