[sheepdog] [PATCH] sheep/cluster/zookeeper: initialize cluster_locks_table with hlist_head

Meng Lingkun menglingkun at cmss.chinamobile.com
Wed Mar 4 06:13:04 CET 2015


Although the size of list_head is the same as hlist_head, it's confused. So fix it.

Signed-off-by: Meng Lingkun <menglingkun at cmss.chinamobile.com>
---
 sheep/cluster/zookeeper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sheep/cluster/zookeeper.c b/sheep/cluster/zookeeper.c
index 4f85043..c44f0ff 100644
--- a/sheep/cluster/zookeeper.c
+++ b/sheep/cluster/zookeeper.c
@@ -1490,7 +1490,7 @@ static int zk_init(const char *option)
 	}
 
 	/* init distributed lock structures */
-	cluster_locks_table = xzalloc(sizeof(struct list_head) *
+	cluster_locks_table = xzalloc(sizeof(struct hlist_head) *
 				      HASH_BUCKET_NR);
 	for (uint64_t i = 0; i < HASH_BUCKET_NR; i++) {
 		INIT_HLIST_HEAD(cluster_locks_table + i);
-- 
1.9.1






More information about the sheepdog mailing list