Signed-off-by: Lai Jiangshan <[email protected]>
---
 rculfhash.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/rculfhash.c b/rculfhash.c
index e7b9f5b..6ba3971 100644
--- a/rculfhash.c
+++ b/rculfhash.c
@@ -1345,17 +1345,19 @@ void cds_lfht_lookup(struct cds_lfht *ht, void *key, 
size_t key_len,
        iter->next = next;
 }
 
-void cds_lfht_next_duplicate(struct cds_lfht *ht, struct cds_lfht_iter *iter)
+static void
+__cds_lfht_next_duplicate_node(struct cds_lfht *ht, struct cds_lfht_iter *iter,
+       struct cds_lfht_node *node)
 {
-       struct cds_lfht_node *node, *next;
+       struct cds_lfht_node *next;
        unsigned long reverse_hash;
        void *key;
        size_t key_len;
 
-       node = iter->node;
        reverse_hash = node->p.reverse_hash;
        key = node->key;
        key_len = node->key_len;
+
        next = iter->next;
        node = clear_flag(next);
 
@@ -1381,6 +1383,11 @@ void cds_lfht_next_duplicate(struct cds_lfht *ht, struct 
cds_lfht_iter *iter)
        iter->next = next;
 }
 
+void cds_lfht_next_duplicate(struct cds_lfht *ht, struct cds_lfht_iter *iter)
+{
+       __cds_lfht_next_duplicate_node(ht, iter, iter->node);
+}
+
 void cds_lfht_next(struct cds_lfht *ht, struct cds_lfht_iter *iter)
 {
        struct cds_lfht_node *node, *next;
-- 
1.7.4.4


_______________________________________________
ltt-dev mailing list
[email protected]
http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev

Reply via email to