- node = cds_hlist_first_entry_rcu(&head, struct ja_test_node, node.list);
- if (!node) {
- fprintf(stderr, "Error lookup node %" PRIu64 "\n", key);
- assert(0);
- }
- ret = cds_ja_del(test_ja, key, &node->node);
- if (ret) {
- fprintf(stderr, "Error (%d) removing node %" PRIu64 "\n", ret, key);
- assert(0);
+
+
+ cds_hlist_for_each_entry_rcu(node, pos, &head, node.list) {
+ struct cds_hlist_head testhead;
+
+ count++;
+ if (!node) {
+ fprintf(stderr, "Error lookup node %" PRIu64 "\n", key);
+ assert(0);
+ }
+ ret = cds_ja_del(test_ja, key, &node->node);
+ if (ret) {
+ fprintf(stderr, "Error (%d) removing node %" PRIu64 "\n", ret, key);
+ assert(0);
+ }
+ call_rcu(&node->node.head, free_node_cb);
+ testhead = cds_ja_lookup(test_ja, key);
+ if (count < nr_dup && cds_hlist_empty(&testhead)) {
+ fprintf(stderr, "Error: no node found after deletion of some nodes of a key\n");
+ assert(0);
+ }