ctdb-daemon: Rename struct srvid_request_data to ctdb_disable_message
authorAmitay Isaacs <amitay@gmail.com>
Wed, 28 Oct 2015 07:23:13 +0000 (18:23 +1100)
committerMartin Schwenke <martins@samba.org>
Tue, 3 Nov 2015 23:47:15 +0000 (00:47 +0100)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/include/ctdb_protocol.h
ctdb/server/ctdb_recoverd.c
ctdb/tools/ctdb.c

index 195fdc949f621211584b6a441198dc9f019ba0c0..3055b812cd9db556d7a7f5f4b195af1ad00cbb33 100644 (file)
@@ -831,10 +831,10 @@ struct ctdb_srvid_message {
        uint64_t srvid;
 };
 
-struct srvid_request_data {
+struct ctdb_disable_message {
        uint32_t pnn;
        uint64_t srvid;
-       uint32_t data;
+       uint32_t timeout;
 };
 
 /* the wire representation for a tcp tickle array */
index d918fc46bbf4d99fb509d33e36bc150951813eff..3c8e5d87ccec767573cc15e2ccdfb0c07bc0d830 100644 (file)
@@ -1733,7 +1733,7 @@ static bool do_takeover_run(struct ctdb_recoverd *rec,
                            bool banning_credits_on_fail)
 {
        uint32_t *nodes = NULL;
-       struct srvid_request_data dtr;
+       struct ctdb_disable_message dtr;
        TDB_DATA data;
        int i;
        uint32_t *rebalance_nodes = rec->force_rebalance_nodes;
@@ -1772,7 +1772,7 @@ static bool do_takeover_run(struct ctdb_recoverd *rec,
        /* Disable for 60 seconds.  This can be a tunable later if
         * necessary.
         */
-       dtr.data = 60;
+       dtr.timeout = 60;
        for (i = 0; i < talloc_array_length(nodes); i++) {
                if (ctdb_client_send_message(rec->ctdb, nodes[i],
                                             CTDB_SRVID_DISABLE_TAKEOVER_RUNS,
@@ -1787,7 +1787,7 @@ static bool do_takeover_run(struct ctdb_recoverd *rec,
                                banning_credits_on_fail ? rec : NULL);
 
        /* Reenable takeover runs and IP checks on other nodes */
-       dtr.data = 0;
+       dtr.timeout = 0;
        for (i = 0; i < talloc_array_length(nodes); i++) {
                if (ctdb_client_send_message(rec->ctdb, nodes[i],
                                             CTDB_SRVID_DISABLE_TAKEOVER_RUNS,
@@ -2700,13 +2700,13 @@ static void srvid_disable_and_reply(struct ctdb_context *ctdb,
                                    TDB_DATA data,
                                    struct ctdb_op_state *op_state)
 {
-       struct srvid_request_data *r;
+       struct ctdb_disable_message *r;
        uint32_t timeout;
        TDB_DATA result;
        int32_t ret = 0;
 
        /* Validate input data */
-       if (data.dsize != sizeof(struct srvid_request_data)) {
+       if (data.dsize != sizeof(struct ctdb_disable_message)) {
                DEBUG(DEBUG_ERR,(__location__ " Wrong size for data :%lu "
                                 "expecting %lu\n", (long unsigned)data.dsize,
                                 (long unsigned)sizeof(struct ctdb_srvid_message)));
@@ -2717,8 +2717,8 @@ static void srvid_disable_and_reply(struct ctdb_context *ctdb,
                return;
        }
 
-       r = (struct srvid_request_data *)data.dptr;
-       timeout = r->data;
+       r = (struct ctdb_disable_message *)data.dptr;
+       timeout = r->timeout;
 
        ret = ctdb_op_disable(op_state, ctdb->ev, timeout);
        if (ret != 0) {
index b51a39dc9a461ff8f6ed3fd078ab0dfdc7befbee..08024d73eea7c1dea7bfe711ff989b1c4903f286 100644 (file)
@@ -2260,7 +2260,7 @@ static int srvid_broadcast(struct ctdb_context *ctdb,
        uint32_t pnn;
        uint64_t reply_srvid;
        struct ctdb_srvid_message request;
-       struct srvid_request_data request_data;
+       struct ctdb_disable_message request_data;
        struct srvid_reply_handler_data reply_data;
        struct timeval tv;
 
@@ -2282,7 +2282,7 @@ static int srvid_broadcast(struct ctdb_context *ctdb,
        } else {
                request_data.pnn = pnn;
                request_data.srvid = reply_srvid;
-               request_data.data = *arg;
+               request_data.timeout = *arg;
 
                data.dptr = (uint8_t *)&request_data;
                data.dsize = sizeof(request_data);