From 853395e1ef65b85c08ddf7b92034f0d51cd5bf46 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 27 Sep 2011 23:27:02 -0400 Subject: [PATCH] rculfhash: fix get first / get next iterator Signed-off-by: Mathieu Desnoyers --- rculfhash.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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); } -- 2.34.1