ctdb-daemon: Rename struct ctdb_iface to ctdb_interface
authorAmitay Isaacs <amitay@gmail.com>
Wed, 28 Oct 2015 06:34:24 +0000 (17:34 +1100)
committerMartin Schwenke <martins@samba.org>
Tue, 3 Nov 2015 23:47:14 +0000 (00:47 +0100)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/include/ctdb_private.h
ctdb/server/ctdb_takeover.c
ctdb/tests/src/ctdb_test_stubs.c

index ebcac9e5b9d55fcabbc87fecf3cdd3fa2688857d..f87c4f368d97d518c1e1fb687a8d778a08096df6 100644 (file)
@@ -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 */
index 3a817bb813c6351ecae6d1add3a6da02cdfa1d5f..4f1211c1770fd9ab80a8a6526f66b95757752c91 100644 (file)
@@ -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;
index 3a04c170aaa07c5d2ee9b08ec940e54e6b246242..b5c998339de0032be607cf4989203481d5572ea0 100644 (file)
@@ -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);