[ltt-dev] [PATCH 1/2] rculfhash: split cds_lfht_next_duplicate()

Lai Jiangshan laijs at cn.fujitsu.com
Thu Oct 20 05:25:43 EDT 2011


Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
---
 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





More information about the lttng-dev mailing list