From 445860bf84c5588406325d7601588c3a8b2ff3f2 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 22 Jun 2016 14:23:38 +1000 Subject: [PATCH] ctdb-ipalloc: IP allocation state is now an opaque structure It is private to the IP allocation module. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/server/ipalloc.h | 14 +------------- ctdb/server/ipalloc_private.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ctdb/server/ipalloc.h b/ctdb/server/ipalloc.h index 13fdfed36eb..66a5e75eb6a 100644 --- a/ctdb/server/ipalloc.h +++ b/ctdb/server/ipalloc.h @@ -43,19 +43,7 @@ enum ipalloc_algorithm { IPALLOC_LCP2, }; -struct ipalloc_state { - uint32_t num; - - /* Arrays with data for each node */ - struct ctdb_public_ip_list *available_public_ips; - bool *noiptakeover; - bool *noiphost; - - struct public_ip_list *all_ips; - enum ipalloc_algorithm algorithm; - bool no_ip_failback; - uint32_t *force_rebalance_nodes; -}; +struct ipalloc_state; struct ipalloc_state * ipalloc_state_init(TALLOC_CTX *mem_ctx, uint32_t num_nodes, diff --git a/ctdb/server/ipalloc_private.h b/ctdb/server/ipalloc_private.h index 3ffdeba2409..232868738bf 100644 --- a/ctdb/server/ipalloc_private.h +++ b/ctdb/server/ipalloc_private.h @@ -26,6 +26,20 @@ #include "server/ipalloc.h" +struct ipalloc_state { + uint32_t num; + + /* Arrays with data for each node */ + struct ctdb_public_ip_list *available_public_ips; + bool *noiptakeover; + bool *noiphost; + + struct public_ip_list *all_ips; + enum ipalloc_algorithm algorithm; + bool no_ip_failback; + uint32_t *force_rebalance_nodes; +}; + bool can_node_takeover_ip(struct ipalloc_state *ipalloc_state, int32_t pnn, struct public_ip_list *ip);