[ltt-dev] [PATCH 6/7] rculfhash: Move key out of struct lfht_test_node

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Sat Nov 5 09:42:53 EDT 2011


* Lai Jiangshan (laijs at cn.fujitsu.com) wrote:
> Make struct lfht_test_node only contains basic field.
> Let user take the responsibility to handle the <key>(hash_set)
> or <key,value>(hash_map) management and calculation.
> 
> Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
[...]
> @@ -424,13 +427,18 @@ int __test_compare(void *key1, size_t key1_len,
>  static
>  int test_compare(struct cds_lfht_node *a, struct cds_lfht_node *b)
>  {
> -	return __test_compare(a->key, a->key_len, b->key, b->key_len);
> +	struct lfht_test_node *u = to_test_node(a);
> +	struct lfht_test_node *v = to_test_node(a);
> +
> +	return __test_compare(u->key, u->key_len, v->key, v->key_len);
>  }
>  

FYI, I think you had a tiny bug here (a -> b for the second). I've
replaced this patch with my own implementation, so it's not a problem.

Thanks,

Mathieu

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




More information about the lttng-dev mailing list