From: Mathieu Desnoyers Date: Wed, 28 Sep 2011 03:27:02 +0000 (-0400) Subject: rculfhash: fix get first / get next iterator X-Git-Tag: v0.7.0~43^2~114 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=853395e1ef65b85c08ddf7b92034f0d51cd5bf46;p=userspace-rcu.git rculfhash: fix get first / get next iterator Signed-off-by: Mathieu Desnoyers --- diff --git a/rculfhash.c b/rculfhash.c index 638432a..0320962 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -1399,10 +1399,7 @@ void cds_lfht_next(struct cds_lfht *ht, struct cds_lfht_iter *iter) { struct cds_lfht_node *node, *next; - node = iter->node; - next = iter->next; - node = clear_flag(next); - + node = clear_flag(iter->next); for (;;) { if (unlikely(is_end(node))) { node = next = NULL; @@ -1429,7 +1426,7 @@ void cds_lfht_first(struct cds_lfht *ht, struct cds_lfht_iter *iter) * first node of the linked list. */ lookup = &ht->t.tbl[0]->nodes[0]; - iter->node = (struct cds_lfht_node *) lookup; + iter->next = lookup->next; cds_lfht_next(ht, iter); }