rculfhash: Add clear flag
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 9 Jul 2011 19:12:28 +0000 (15:12 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 9 Jul 2011 19:12:28 +0000 (15:12 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rculfhash.c

index 2ec91f2f51b6ffd37a7d295a66f52c99ade80791..da04b9dce7ced2659a0b89ee6fd806d3dc97c439 100644 (file)
@@ -222,7 +222,7 @@ void _ht_gc_bucket(struct rcu_ht_node *dummy, struct rcu_ht_node *node)
                iter = rcu_dereference(iter_prev->p.next);
                assert(iter_prev->p.reverse_hash <= node->p.reverse_hash);
                for (;;) {
-                       if (unlikely(!iter))
+                       if (unlikely(!clear_flag(iter)))
                                return;
                        if (clear_flag(iter)->p.reverse_hash > node->p.reverse_hash)
                                return;
@@ -261,7 +261,7 @@ struct rcu_ht_node *_ht_add(struct rcu_ht *ht, struct rcu_table *t,
                iter = rcu_dereference(iter_prev->p.next);
                assert(iter_prev->p.reverse_hash <= node->p.reverse_hash);
                for (;;) {
-                       if (unlikely(!iter))
+                       if (unlikely(!clear_flag(iter)))
                                goto insert;
                        if (clear_flag(iter)->p.reverse_hash > node->p.reverse_hash)
                                goto insert;
@@ -465,7 +465,7 @@ int ht_delete_dummy(struct rcu_ht *ht)
                        return -EPERM;
                node = node->p.next;
                assert(!is_removed(node));
-       } while (node);
+       } while (clear_flag(node));
        /* Internal sanity check: all nodes left should be dummy */
        for (i = 0; i < t->size; i++) {
                assert(t->tbl[i]->p.dummy);
This page took 0.027306 seconds and 4 git commands to generate.