struct lfht_test_node {
struct cds_lfht_node node;
+ /* cache-cold for iteration */
+ struct rcu_head head;
};
static inline struct lfht_test_node *
void free_node_cb(struct rcu_head *head)
{
struct lfht_test_node *node =
- caa_container_of(head, struct lfht_test_node, node.head);
+ caa_container_of(head, struct lfht_test_node, head);
free(node);
}
nr_addexist++;
} else {
if (add_replace && ret_node) {
- call_rcu(&to_test_node(ret_node)->node.head,
+ call_rcu(&to_test_node(ret_node)->head,
free_node_cb);
nr_addexist++;
} else {
rcu_read_unlock();
if (ret == 0) {
node = cds_lfht_iter_get_test_node(&iter);
- call_rcu(&node->node.head, free_node_cb);
+ call_rcu(&node->head, free_node_cb);
nr_del++;
} else
nr_delnoent++;
nr_addexist++;
} else {
if (add_replace && ret_node) {
- call_rcu(&to_test_node(ret_node)->node.head, free_node_cb);
+ call_rcu(&to_test_node(ret_node)->head, free_node_cb);
nr_addexist++;
} else {
nr_add++;
ret = cds_lfht_del(test_ht, &iter);
assert(!ret);
- call_rcu(&node->node.head, free_node_cb);
+ call_rcu(&node->head, free_node_cb);
cds_lfht_next(ht, &iter);
count++;
}