From mboxrd@z Thu Jan 1 00:00:00 1970 From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers) Date: Sat, 5 Nov 2011 09:42:53 -0400 Subject: [ltt-dev] [PATCH 6/7] rculfhash: Move key out of struct lfht_test_node In-Reply-To: <14c55f6a4b1c3639c2fd1dfa31665b283ff17e5e.1320217693.git.laijs@cn.fujitsu.com> References: <14c55f6a4b1c3639c2fd1dfa31665b283ff17e5e.1320217693.git.laijs@cn.fujitsu.com> Message-ID: <20111105134253.GE15862@Krystal> * 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 (hash_set) > or (hash_map) management and calculation. > > Signed-off-by: Lai Jiangshan [...] > @@ -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