-}
-
-static void rb_insert(struct node *n)
-{
- struct rb_node **p, *parent;
-
- memset(&n->rb, 0, sizeof(n->rb));
- p = &rb.rb_node;
- parent = NULL;
- while (*p) {
- struct node *__n;
-
- parent = *p;
- __n = rb_entry(parent, struct node, rb);
- if (n->hits > __n->hits)
- p = &(*p)->rb_left;
- else
- p = &(*p)->rb_right;
- }
-
- rb_link_node(&n->rb, parent, p);
- rb_insert_color(&n->rb, &rb);
-}
-
-static unsigned long rb_add(struct flist_head *list)
-{
- struct flist_head *entry;
- unsigned long ret = 0;
- struct node *n;
-
- flist_for_each(entry, list) {
- n = flist_entry(entry, struct node, list);
-
- rb_insert(n);
- ret++;
- }
-
- return ret;
-}
-
-static unsigned long rb_gen(void)
-{
- unsigned long ret = 0;
- unsigned int i;
-
- for (i = 0; i < hash_size; i++)
- ret += rb_add(&hash[i]);
-
- return ret;