1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

ctdb-daemon: Rename struct ctdb_all_public_ips to ctdb_public_ip_list_old

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2015-10-28 17:16:24 +11:00 committed by Martin Schwenke
parent 2b76e58032
commit 04eaa077aa
8 changed files with 37 additions and 36 deletions

View File

@ -2774,7 +2774,7 @@ int ctdb_ctrl_get_public_ips_flags(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode, struct timeval timeout, uint32_t destnode,
TALLOC_CTX *mem_ctx, TALLOC_CTX *mem_ctx,
uint32_t flags, uint32_t flags,
struct ctdb_all_public_ips **ips) struct ctdb_public_ip_list_old **ips)
{ {
int ret; int ret;
TDB_DATA outdata; TDB_DATA outdata;
@ -2790,7 +2790,7 @@ int ctdb_ctrl_get_public_ips_flags(struct ctdb_context *ctdb,
return -1; return -1;
} }
*ips = (struct ctdb_all_public_ips *)talloc_memdup(mem_ctx, outdata.dptr, outdata.dsize); *ips = (struct ctdb_public_ip_list_old *)talloc_memdup(mem_ctx, outdata.dptr, outdata.dsize);
talloc_free(outdata.dptr); talloc_free(outdata.dptr);
return 0; return 0;
@ -2799,7 +2799,7 @@ int ctdb_ctrl_get_public_ips_flags(struct ctdb_context *ctdb,
int ctdb_ctrl_get_public_ips(struct ctdb_context *ctdb, int ctdb_ctrl_get_public_ips(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode, struct timeval timeout, uint32_t destnode,
TALLOC_CTX *mem_ctx, TALLOC_CTX *mem_ctx,
struct ctdb_all_public_ips **ips) struct ctdb_public_ip_list_old **ips)
{ {
return ctdb_ctrl_get_public_ips_flags(ctdb, timeout, return ctdb_ctrl_get_public_ips_flags(ctdb, timeout,
destnode, mem_ctx, destnode, mem_ctx,

View File

@ -370,11 +370,11 @@ int ctdb_ctrl_list_tunables(struct ctdb_context *ctdb,
int ctdb_ctrl_get_public_ips_flags(struct ctdb_context *ctdb, int ctdb_ctrl_get_public_ips_flags(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode, struct timeval timeout, uint32_t destnode,
TALLOC_CTX *mem_ctx, uint32_t flags, TALLOC_CTX *mem_ctx, uint32_t flags,
struct ctdb_all_public_ips **ips); struct ctdb_public_ip_list_old **ips);
int ctdb_ctrl_get_public_ips(struct ctdb_context *ctdb, int ctdb_ctrl_get_public_ips(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode, struct timeval timeout, uint32_t destnode,
TALLOC_CTX *mem_ctx, TALLOC_CTX *mem_ctx,
struct ctdb_all_public_ips **ips); struct ctdb_public_ip_list_old **ips);
int ctdb_ctrl_get_public_ip_info(struct ctdb_context *ctdb, int ctdb_ctrl_get_public_ip_info(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode, struct timeval timeout, uint32_t destnode,
TALLOC_CTX *mem_ctx, TALLOC_CTX *mem_ctx,

View File

@ -130,8 +130,8 @@ struct ctdb_node {
across the nodes. it needs to know which public ip's can be handled across the nodes. it needs to know which public ip's can be handled
by each node. by each node.
*/ */
struct ctdb_all_public_ips *known_public_ips; struct ctdb_public_ip_list_old *known_public_ips;
struct ctdb_all_public_ips *available_public_ips; struct ctdb_public_ip_list_old *available_public_ips;
/* used by the recovery dameon to track when a node should be banned */ /* used by the recovery dameon to track when a node should be banned */
struct ctdb_banning_state *ban_state; struct ctdb_banning_state *ban_state;
}; };
@ -1008,7 +1008,7 @@ int32_t ctdb_control_del_public_address(struct ctdb_context *ctdb,
TDB_DATA recdata, bool *async_reply); TDB_DATA recdata, bool *async_reply);
int verify_remote_ip_allocation(struct ctdb_context *ctdb, int verify_remote_ip_allocation(struct ctdb_context *ctdb,
struct ctdb_all_public_ips *ips, struct ctdb_public_ip_list_old *ips,
uint32_t pnn); uint32_t pnn);
int update_ip_assignment_tree(struct ctdb_context *ctdb, int update_ip_assignment_tree(struct ctdb_context *ctdb,
struct ctdb_public_ip *ip); struct ctdb_public_ip *ip);

View File

@ -596,7 +596,7 @@ struct ctdb_public_ip {
ctdb_sock_addr addr; ctdb_sock_addr addr;
}; };
struct ctdb_all_public_ips { struct ctdb_public_ip_list_old {
uint32_t num; uint32_t num;
struct ctdb_public_ip ips[1]; struct ctdb_public_ip ips[1];
}; };

View File

@ -3379,7 +3379,7 @@ static int verify_local_ip_allocation(struct ctdb_context *ctdb, struct ctdb_rec
we also request a ip reallocation. we also request a ip reallocation.
*/ */
if (ctdb->tunable.disable_ip_failover == 0) { if (ctdb->tunable.disable_ip_failover == 0) {
struct ctdb_all_public_ips *ips = NULL; struct ctdb_public_ip_list_old *ips = NULL;
/* read the *available* IPs from the local node */ /* read the *available* IPs from the local node */
ret = ctdb_ctrl_get_public_ips_flags(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, mem_ctx, CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE, &ips); ret = ctdb_ctrl_get_public_ips_flags(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, mem_ctx, CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE, &ips);

View File

@ -1258,7 +1258,7 @@ static bool can_node_host_ip(struct ctdb_context *ctdb, int32_t pnn,
struct ctdb_ipflags ipflags, struct ctdb_ipflags ipflags,
struct public_ip_list *ip) struct public_ip_list *ip)
{ {
struct ctdb_all_public_ips *public_ips; struct ctdb_public_ip_list_old *public_ips;
int i; int i;
if (ipflags.noiphost) { if (ipflags.noiphost) {
@ -1393,7 +1393,7 @@ create_merged_ip_list(struct ctdb_context *ctdb)
{ {
int i, j; int i, j;
struct public_ip_list *ip_list; struct public_ip_list *ip_list;
struct ctdb_all_public_ips *public_ips; struct ctdb_public_ip_list_old *public_ips;
if (ctdb->ip_tree != NULL) { if (ctdb->ip_tree != NULL) {
talloc_free(ctdb->ip_tree); talloc_free(ctdb->ip_tree);
@ -3199,7 +3199,7 @@ int32_t ctdb_control_get_public_ips(struct ctdb_context *ctdb,
struct ctdb_req_control_old *c, TDB_DATA *outdata) struct ctdb_req_control_old *c, TDB_DATA *outdata)
{ {
int i, num, len; int i, num, len;
struct ctdb_all_public_ips *ips; struct ctdb_public_ip_list_old *ips;
struct ctdb_vnn *vnn; struct ctdb_vnn *vnn;
bool only_available = false; bool only_available = false;
@ -3213,7 +3213,7 @@ int32_t ctdb_control_get_public_ips(struct ctdb_context *ctdb,
num++; num++;
} }
len = offsetof(struct ctdb_all_public_ips, ips) + len = offsetof(struct ctdb_public_ip_list_old, ips) +
num*sizeof(struct ctdb_public_ip); num*sizeof(struct ctdb_public_ip);
ips = talloc_zero_size(outdata, len); ips = talloc_zero_size(outdata, len);
CTDB_NO_MEMORY(ctdb, ips); CTDB_NO_MEMORY(ctdb, ips);
@ -3228,7 +3228,7 @@ int32_t ctdb_control_get_public_ips(struct ctdb_context *ctdb,
i++; i++;
} }
ips->num = i; ips->num = i;
len = offsetof(struct ctdb_all_public_ips, ips) + len = offsetof(struct ctdb_public_ip_list_old, ips) +
i*sizeof(struct ctdb_public_ip); i*sizeof(struct ctdb_public_ip);
outdata->dsize = len; outdata->dsize = len;
@ -4225,7 +4225,7 @@ int32_t ctdb_control_ipreallocated(struct ctdb_context *ctdb,
This is verified against ctdb->ip_tree This is verified against ctdb->ip_tree
*/ */
int verify_remote_ip_allocation(struct ctdb_context *ctdb, int verify_remote_ip_allocation(struct ctdb_context *ctdb,
struct ctdb_all_public_ips *ips, struct ctdb_public_ip_list_old *ips,
uint32_t pnn) uint32_t pnn)
{ {
struct public_ip_list *tmp_ip; struct public_ip_list *tmp_ip;
@ -4349,7 +4349,7 @@ static void ctdb_reloadips_child_handler(struct tevent_context *ev,
static int ctdb_reloadips_child(struct ctdb_context *ctdb) static int ctdb_reloadips_child(struct ctdb_context *ctdb)
{ {
TALLOC_CTX *mem_ctx = talloc_new(NULL); TALLOC_CTX *mem_ctx = talloc_new(NULL);
struct ctdb_all_public_ips *ips; struct ctdb_public_ip_list_old *ips;
struct ctdb_vnn *vnn; struct ctdb_vnn *vnn;
struct client_async_data *async_data; struct client_async_data *async_data;
struct timeval timeout; struct timeval timeout;

View File

@ -103,20 +103,21 @@ static bool
read_ctdb_public_ip_info(TALLOC_CTX *ctx, read_ctdb_public_ip_info(TALLOC_CTX *ctx,
int numnodes, int numnodes,
struct public_ip_list ** all_ips, struct public_ip_list ** all_ips,
struct ctdb_all_public_ips *** avail) struct ctdb_public_ip_list_old *** avail)
{ {
char line[1024]; char line[1024];
ctdb_sock_addr addr; ctdb_sock_addr addr;
char *t, *tok; char *t, *tok;
struct public_ip_list * ta; struct public_ip_list * ta;
int pnn, numips, curr, n, i; int pnn, numips, curr, n, i;
struct ctdb_all_public_ips * a; struct ctdb_public_ip_list_old * a;
struct public_ip_list *last = NULL; struct public_ip_list *last = NULL;
*avail = talloc_array_size(ctx, sizeof(struct ctdb_all_public_ips *), CTDB_TEST_MAX_NODES); *avail = talloc_array_size(ctx, sizeof(struct ctdb_public_ip_list_old *),
CTDB_TEST_MAX_NODES);
memset(*avail, 0, memset(*avail, 0,
sizeof(struct ctdb_all_public_ips *) * CTDB_TEST_MAX_NODES); sizeof(struct ctdb_public_ip_list_old *) * CTDB_TEST_MAX_NODES);
numips = 0; numips = 0;
*all_ips = NULL; *all_ips = NULL;
@ -181,7 +182,7 @@ read_ctdb_public_ip_info(TALLOC_CTX *ctx,
while (t != NULL) { while (t != NULL) {
n = (int) strtol(t, (char **) NULL, 10); n = (int) strtol(t, (char **) NULL, 10);
if ((*avail)[n] == NULL) { if ((*avail)[n] == NULL) {
(*avail)[n] = talloc_array(ctx, struct ctdb_all_public_ips, CTDB_TEST_MAX_IPS); (*avail)[n] = talloc_array(ctx, struct ctdb_public_ip_list_old, CTDB_TEST_MAX_IPS);
(*avail)[n]->num = 0; (*avail)[n]->num = 0;
} }
curr = (*avail)[n]->num; curr = (*avail)[n]->num;
@ -195,7 +196,7 @@ read_ctdb_public_ip_info(TALLOC_CTX *ctx,
} }
/* Build list of all allowed IPs */ /* Build list of all allowed IPs */
a = talloc_array(ctx, struct ctdb_all_public_ips, CTDB_TEST_MAX_IPS); a = talloc_array(ctx, struct ctdb_public_ip_list_old, CTDB_TEST_MAX_IPS);
a->num = numips; a->num = numips;
for (ta = *all_ips, i=0; ta != NULL && i < numips ; ta = ta->next, i++) { for (ta = *all_ips, i=0; ta != NULL && i < numips ; ta = ta->next, i++) {
a->ips[i].pnn = ta->pnn; a->ips[i].pnn = ta->pnn;
@ -213,7 +214,7 @@ read_ctdb_public_ip_info(TALLOC_CTX *ctx,
} }
static void print_ctdb_available_ips(int numnodes, static void print_ctdb_available_ips(int numnodes,
struct ctdb_all_public_ips **avail) struct ctdb_public_ip_list_old **avail)
{ {
int n, i; int n, i;
@ -234,7 +235,7 @@ static void ctdb_test_read_ctdb_public_ip_info(const char nodestates[])
{ {
int numnodes; int numnodes;
struct public_ip_list *l; struct public_ip_list *l;
struct ctdb_all_public_ips **avail; struct ctdb_public_ip_list_old **avail;
char *tok, *ns; char *tok, *ns;
TALLOC_CTX *tmp_ctx = talloc_new(NULL); TALLOC_CTX *tmp_ctx = talloc_new(NULL);
@ -412,7 +413,7 @@ static void ctdb_test_init(const char nodestates[],
struct ctdb_ipflags **ipflags, struct ctdb_ipflags **ipflags,
bool read_ips_for_multiple_nodes) bool read_ips_for_multiple_nodes)
{ {
struct ctdb_all_public_ips **avail; struct ctdb_public_ip_list_old **avail;
int i, numnodes; int i, numnodes;
uint32_t nodeflags[CTDB_TEST_MAX_NODES]; uint32_t nodeflags[CTDB_TEST_MAX_NODES];
char *tok, *ns, *t; char *tok, *ns, *t;

View File

@ -1748,7 +1748,7 @@ static int control_get_tickles(struct ctdb_context *ctdb, int argc, const char *
static int move_ip(struct ctdb_context *ctdb, ctdb_sock_addr *addr, uint32_t pnn) static int move_ip(struct ctdb_context *ctdb, ctdb_sock_addr *addr, uint32_t pnn)
{ {
struct ctdb_all_public_ips *ips; struct ctdb_public_ip_list_old *ips;
struct ctdb_public_ip ip; struct ctdb_public_ip ip;
int i, ret; int i, ret;
uint32_t *nodes; uint32_t *nodes;
@ -1843,7 +1843,7 @@ static int
find_other_host_for_public_ip(struct ctdb_context *ctdb, ctdb_sock_addr *addr) find_other_host_for_public_ip(struct ctdb_context *ctdb, ctdb_sock_addr *addr)
{ {
TALLOC_CTX *tmp_ctx = talloc_new(ctdb); TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
struct ctdb_all_public_ips *ips; struct ctdb_public_ip_list_old *ips;
struct ctdb_node_map_old *nodemap=NULL; struct ctdb_node_map_old *nodemap=NULL;
int i, j, ret; int i, j, ret;
int pnn; int pnn;
@ -2077,7 +2077,7 @@ static int control_rebalanceip(struct ctdb_context *ctdb, int argc, const char *
static int getips_store_callback(void *param, void *data) static int getips_store_callback(void *param, void *data)
{ {
struct ctdb_public_ip *node_ip = (struct ctdb_public_ip *)data; struct ctdb_public_ip *node_ip = (struct ctdb_public_ip *)data;
struct ctdb_all_public_ips *ips = param; struct ctdb_public_ip_list_old *ips = param;
int i; int i;
i = ips->num++; i = ips->num++;
@ -2127,9 +2127,9 @@ static void *add_ip_callback(void *parm, void *data)
} }
static int static int
control_get_all_public_ips(struct ctdb_context *ctdb, TALLOC_CTX *tmp_ctx, struct ctdb_all_public_ips **ips) control_get_all_public_ips(struct ctdb_context *ctdb, TALLOC_CTX *tmp_ctx, struct ctdb_public_ip_list_old **ips)
{ {
struct ctdb_all_public_ips *tmp_ips; struct ctdb_public_ip_list_old *tmp_ips;
struct ctdb_node_map_old *nodemap=NULL; struct ctdb_node_map_old *nodemap=NULL;
trbt_tree_t *ip_tree; trbt_tree_t *ip_tree;
int i, j, len, ret; int i, j, len, ret;
@ -2177,7 +2177,7 @@ control_get_all_public_ips(struct ctdb_context *ctdb, TALLOC_CTX *tmp_ctx, struc
count = 0; count = 0;
trbt_traversearray32(ip_tree, IP_KEYLEN, getips_count_callback, &count); trbt_traversearray32(ip_tree, IP_KEYLEN, getips_count_callback, &count);
len = offsetof(struct ctdb_all_public_ips, ips) + len = offsetof(struct ctdb_public_ip_list_old, ips) +
count*sizeof(struct ctdb_public_ip); count*sizeof(struct ctdb_public_ip);
tmp_ips = talloc_zero_size(tmp_ctx, len); tmp_ips = talloc_zero_size(tmp_ctx, len);
trbt_traversearray32(ip_tree, IP_KEYLEN, getips_store_callback, tmp_ips); trbt_traversearray32(ip_tree, IP_KEYLEN, getips_store_callback, tmp_ips);
@ -2378,7 +2378,7 @@ static int control_addip(struct ctdb_context *ctdb, int argc, const char **argv)
ctdb_sock_addr addr; ctdb_sock_addr addr;
struct ctdb_control_ip_iface *pub; struct ctdb_control_ip_iface *pub;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb); TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
struct ctdb_all_public_ips *ips; struct ctdb_public_ip_list_old *ips;
if (argc != 2) { if (argc != 2) {
@ -2482,7 +2482,7 @@ static int control_delip_all(struct ctdb_context *ctdb, int argc, const char **a
{ {
TALLOC_CTX *tmp_ctx = talloc_new(ctdb); TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
struct ctdb_node_map_old *nodemap=NULL; struct ctdb_node_map_old *nodemap=NULL;
struct ctdb_all_public_ips *ips; struct ctdb_public_ip_list_old *ips;
int ret, i, j; int ret, i, j;
ret = ctdb_ctrl_getnodemap(ctdb, TIMELIMIT(), CTDB_CURRENT_NODE, tmp_ctx, &nodemap); ret = ctdb_ctrl_getnodemap(ctdb, TIMELIMIT(), CTDB_CURRENT_NODE, tmp_ctx, &nodemap);
@ -2557,7 +2557,7 @@ static int control_delip(struct ctdb_context *ctdb, int argc, const char **argv)
ctdb_sock_addr addr; ctdb_sock_addr addr;
struct ctdb_control_ip_iface pub; struct ctdb_control_ip_iface pub;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb); TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
struct ctdb_all_public_ips *ips; struct ctdb_public_ip_list_old *ips;
if (argc != 1) { if (argc != 1) {
talloc_free(tmp_ctx); talloc_free(tmp_ctx);
@ -2964,7 +2964,7 @@ static int control_ip(struct ctdb_context *ctdb, int argc, const char **argv)
{ {
int i, ret; int i, ret;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb); TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
struct ctdb_all_public_ips *ips; struct ctdb_public_ip_list_old *ips;
if (argc == 1 && strcmp(argv[0], "all") == 0) { if (argc == 1 && strcmp(argv[0], "all") == 0) {
options.pnn = CTDB_BROADCAST_ALL; options.pnn = CTDB_BROADCAST_ALL;