From a9f335fcc2af906770212abaedfceb30a81ad409 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Wed, 28 Oct 2015 17:34:24 +1100 Subject: [PATCH] ctdb-daemon: Rename struct ctdb_iface to ctdb_interface Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- ctdb/include/ctdb_private.h | 4 +-- ctdb/server/ctdb_takeover.c | 42 ++++++++++++++++---------------- ctdb/tests/src/ctdb_test_stubs.c | 12 ++++----- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index ebcac9e5b9d..f87c4f368d9 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -75,7 +75,7 @@ struct ctdb_client { struct ctdb_vnn { struct ctdb_vnn *prev, *next; - struct ctdb_iface *iface; + struct ctdb_interface *iface; const char **ifaces; ctdb_sock_addr public_address; uint8_t public_netmask_bits; @@ -327,7 +327,7 @@ struct ctdb_context { struct ctdb_node **nodes; /* array of nodes in the cluster - indexed by vnn */ struct ctdb_vnn *vnn; /* list of public ip addresses and interfaces */ struct ctdb_vnn *single_ip_vnn; /* a structure for the single ip */ - struct ctdb_iface *ifaces; /* list of local interfaces */ + struct ctdb_interface *ifaces; /* list of local interfaces */ char *err_msg; const struct ctdb_methods *methods; /* transport methods */ const struct ctdb_upcalls *upcalls; /* transport upcalls */ diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index 3a817bb813c..4f1211c1770 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -53,8 +53,8 @@ struct ctdb_ipflags { enum ctdb_runstate runstate; }; -struct ctdb_iface { - struct ctdb_iface *prev, *next; +struct ctdb_interface { + struct ctdb_interface *prev, *next; const char *name; bool link_up; uint32_t references; @@ -71,7 +71,7 @@ static const char *ctdb_vnn_iface_string(const struct ctdb_vnn *vnn) static int ctdb_add_local_iface(struct ctdb_context *ctdb, const char *iface) { - struct ctdb_iface *i; + struct ctdb_interface *i; /* Verify that we dont have an entry for this ip yet */ for (i=ctdb->ifaces;i;i=i->next) { @@ -81,7 +81,7 @@ static int ctdb_add_local_iface(struct ctdb_context *ctdb, const char *iface) } /* create a new structure for this interface */ - i = talloc_zero(ctdb, struct ctdb_iface); + i = talloc_zero(ctdb, struct ctdb_interface); CTDB_NO_MEMORY_FATAL(ctdb, i); i->name = talloc_strdup(i, iface); CTDB_NO_MEMORY(ctdb, i->name); @@ -122,7 +122,7 @@ static bool vnn_has_interface_with_name(struct ctdb_vnn *vnn, static void ctdb_remove_orphaned_ifaces(struct ctdb_context *ctdb, struct ctdb_vnn *vnn) { - struct ctdb_iface *i, *next; + struct ctdb_interface *i, *next; /* For each interface, check if there's an IP using it. */ for (i = ctdb->ifaces; i != NULL; i = next) { @@ -160,10 +160,10 @@ static void ctdb_remove_orphaned_ifaces(struct ctdb_context *ctdb, } -static struct ctdb_iface *ctdb_find_iface(struct ctdb_context *ctdb, - const char *iface) +static struct ctdb_interface *ctdb_find_iface(struct ctdb_context *ctdb, + const char *iface) { - struct ctdb_iface *i; + struct ctdb_interface *i; for (i=ctdb->ifaces;i;i=i->next) { if (strcmp(i->name, iface) == 0) { @@ -174,12 +174,12 @@ static struct ctdb_iface *ctdb_find_iface(struct ctdb_context *ctdb, return NULL; } -static struct ctdb_iface *ctdb_vnn_best_iface(struct ctdb_context *ctdb, - struct ctdb_vnn *vnn) +static struct ctdb_interface *ctdb_vnn_best_iface(struct ctdb_context *ctdb, + struct ctdb_vnn *vnn) { int i; - struct ctdb_iface *cur = NULL; - struct ctdb_iface *best = NULL; + struct ctdb_interface *cur = NULL; + struct ctdb_interface *best = NULL; for (i=0; vnn->ifaces[i]; i++) { @@ -209,7 +209,7 @@ static struct ctdb_iface *ctdb_vnn_best_iface(struct ctdb_context *ctdb, static int32_t ctdb_vnn_assign_iface(struct ctdb_context *ctdb, struct ctdb_vnn *vnn) { - struct ctdb_iface *best = NULL; + struct ctdb_interface *best = NULL; if (vnn->iface) { DEBUG(DEBUG_INFO, (__location__ " public address '%s' " @@ -270,7 +270,7 @@ static bool ctdb_vnn_available(struct ctdb_context *ctdb, } for (i=0; vnn->ifaces[i]; i++) { - struct ctdb_iface *cur; + struct ctdb_interface *cur; cur = ctdb_find_iface(ctdb, vnn->ifaces[i]); if (cur == NULL) { @@ -535,7 +535,7 @@ static int32_t ctdb_do_takeip(struct ctdb_context *ctdb, struct ctdb_do_updateip_state { struct ctdb_req_control_old *c; - struct ctdb_iface *old; + struct ctdb_interface *old; struct ctdb_vnn *vnn; }; @@ -603,7 +603,7 @@ static int32_t ctdb_do_updateip(struct ctdb_context *ctdb, { int ret; struct ctdb_do_updateip_state *state; - struct ctdb_iface *old = vnn->iface; + struct ctdb_interface *old = vnn->iface; const char *new_name; if (vnn->update_in_flight) { @@ -704,7 +704,7 @@ int32_t ctdb_control_takeover_ip(struct ctdb_context *ctdb, bool have_ip = false; bool do_updateip = false; bool do_takeip = false; - struct ctdb_iface *best_iface = NULL; + struct ctdb_interface *best_iface = NULL; if (pip->pnn != ctdb->pnn) { DEBUG(DEBUG_ERR,(__location__" takeoverip called for an ip '%s' " @@ -1181,7 +1181,7 @@ int ctdb_set_single_public_ip(struct ctdb_context *ctdb, const char *ip) { struct ctdb_vnn *svnn; - struct ctdb_iface *cur = NULL; + struct ctdb_interface *cur = NULL; bool ok; int ret; @@ -3282,7 +3282,7 @@ int32_t ctdb_control_get_public_ip_info(struct ctdb_context *ctdb, info->active_idx = 0xFFFFFFFF; for (i=0; vnn->ifaces[i]; i++) { - struct ctdb_iface *cur; + struct ctdb_interface *cur; cur = ctdb_find_iface(ctdb, vnn->ifaces[i]); if (cur == NULL) { @@ -3313,7 +3313,7 @@ int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb, { int i, num, len; struct ctdb_control_get_ifaces *ifaces; - struct ctdb_iface *cur; + struct ctdb_interface *cur; /* count how many public ip structures we have */ num = 0; @@ -3348,7 +3348,7 @@ int32_t ctdb_control_set_iface_link(struct ctdb_context *ctdb, TDB_DATA indata) { struct ctdb_control_iface_info *info; - struct ctdb_iface *iface; + struct ctdb_interface *iface; bool link_up = false; info = (struct ctdb_control_iface_info *)indata.dptr; diff --git a/ctdb/tests/src/ctdb_test_stubs.c b/ctdb/tests/src/ctdb_test_stubs.c index 3a04c170aaa..b5c998339de 100644 --- a/ctdb/tests/src/ctdb_test_stubs.c +++ b/ctdb/tests/src/ctdb_test_stubs.c @@ -175,8 +175,8 @@ static void ctdb_test_stubs_print_nodemap(struct ctdb_context *ctdb) * :eth1:1:4294967292 */ -struct ctdb_iface { - struct ctdb_iface *prev, *next; +struct ctdb_interface { + struct ctdb_interface *prev, *next; const char *name; bool link_up; uint32_t references; @@ -185,7 +185,7 @@ struct ctdb_iface { static void ctdb_test_stubs_read_ifaces(struct ctdb_context *ctdb) { char line[1024]; - struct ctdb_iface *iface; + struct ctdb_interface *iface; while ((fgets(line, sizeof(line), stdin) != NULL) && (line[0] != '\n')) { @@ -227,7 +227,7 @@ static void ctdb_test_stubs_read_ifaces(struct ctdb_context *ctdb) } references = (uint32_t)strtoul(tok, NULL, 0); - iface = talloc_zero(ctdb, struct ctdb_iface); + iface = talloc_zero(ctdb, struct ctdb_interface); if (iface == NULL) { DEBUG(DEBUG_ERR, ("OOM allocating iface\n")); @@ -253,7 +253,7 @@ static void assert_ifaces_set(struct ctdb_context *ctdb) #ifdef CTDB_TEST_OVERRIDE_MAIN static void ctdb_test_stubs_print_ifaces(struct ctdb_context *ctdb) { - struct ctdb_iface *iface; + struct ctdb_interface *iface; assert_ifaces_set(ctdb); @@ -545,7 +545,7 @@ int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb, { int i, num, len; struct ctdb_control_get_ifaces *ifaces; - struct ctdb_iface *cur; + struct ctdb_interface *cur; assert_ifaces_set(ctdb); -- 2.34.1