rename ctdb_send_message to ctdb_client_send_message to resolve colission with the...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 1 Jun 2010 23:45:21 +0000 (09:45 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 1 Jun 2010 23:45:21 +0000 (09:45 +1000)
client/ctdb_client.c
common/ctdb_logging.c
include/ctdb_client.h
server/ctdb_recoverd.c
server/ctdb_vacuum.c
tests/src/ctdb_bench.c
tests/src/ctdb_fetch.c
tools/ctdb.c
tools/ctdb_vacuum.c

index 946335c9ff2a26369b0a73859986f5d81d1d324e..ba8d2fd9e03560bb3e2cc25be2d5af22ef8b2d0c 100644 (file)
@@ -517,7 +517,7 @@ int ctdb_remove_message_handler(struct ctdb_context *ctdb, uint64_t srvid, void
 /*
   send a message - from client context
  */
-int ctdb_send_message(struct ctdb_context *ctdb, uint32_t pnn,
+int ctdb_client_send_message(struct ctdb_context *ctdb, uint32_t pnn,
                      uint64_t srvid, TDB_DATA data)
 {
        struct ctdb_req_message *r;
index 6acc060a21149c812eef40242e9c102e4bebd0bf..18aafa23322383851cc7372b3555e9d283591668 100644 (file)
@@ -144,7 +144,7 @@ static void ctdb_collect_log(struct ctdb_context *ctdb, struct ctdb_get_log_addr
        DEBUG(DEBUG_ERR,("Marshalling log entries into a blob of %d bytes\n", (int)data.dsize));
 
        DEBUG(DEBUG_ERR,("Send log to %d:%d\n", (int)log_addr->pnn, (int)log_addr->srvid));
-       ctdb_send_message(ctdb, log_addr->pnn, log_addr->srvid, data);
+       ctdb_client_send_message(ctdb, log_addr->pnn, log_addr->srvid, data);
 
        talloc_free(data.dptr);
 }
index 394b89ea9aac99ce1dee76529aec24f1ce81e9ee..a158cbde1db8c3afcb9a1c8c4c20b8a9a5dc35d7 100644 (file)
@@ -164,7 +164,7 @@ struct ctdb_client_call_state *ctdb_call_send(struct ctdb_db_context *ctdb_db, s
 int ctdb_call_recv(struct ctdb_client_call_state *state, struct ctdb_call *call);
 
 /* send a ctdb message */
-int ctdb_send_message(struct ctdb_context *ctdb, uint32_t pnn,
+int ctdb_client_send_message(struct ctdb_context *ctdb, uint32_t pnn,
                      uint64_t srvid, TDB_DATA data);
 
 
index ae4242f4cd969af8b90f7418d74dd877bcb32f01..5b7bdb7d5e909f61181aaec919acd7997e4d0c38 100644 (file)
@@ -1641,7 +1641,7 @@ static int do_recovery(struct ctdb_recoverd *rec,
 
        /* send a message to all clients telling them that the cluster 
           has been reconfigured */
-       ctdb_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_RECONFIGURE, tdb_null);
+       ctdb_client_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_RECONFIGURE, tdb_null);
 
        DEBUG(DEBUG_NOTICE, (__location__ " Recovery complete\n"));
 
@@ -1802,7 +1802,7 @@ static int send_election_request(struct ctdb_recoverd *rec, uint32_t pnn, bool u
 
        /* send an election message to all active nodes */
        DEBUG(DEBUG_INFO,(__location__ " Send election request to all active nodes\n"));
-       ctdb_send_message(ctdb, CTDB_BROADCAST_ALL, srvid, election_data);
+       ctdb_client_send_message(ctdb, CTDB_BROADCAST_ALL, srvid, election_data);
 
 
        /* A new node that is already frozen has entered the cluster.
@@ -1900,7 +1900,7 @@ static void mem_dump_handler(struct ctdb_context *ctdb, uint64_t srvid,
 
 DEBUG(DEBUG_ERR, ("recovery master memory dump\n"));           
 
-       ret = ctdb_send_message(ctdb, rd->pnn, rd->srvid, *dump);
+       ret = ctdb_client_send_message(ctdb, rd->pnn, rd->srvid, *dump);
        if (ret != 0) {
                DEBUG(DEBUG_ERR,("Failed to send rd memdump reply message\n"));
                talloc_free(tmp_ctx);
@@ -2059,7 +2059,7 @@ static void process_ipreallocate_requests(struct ctdb_context *ctdb, struct ctdb
                DEBUG(DEBUG_INFO,("Sending ip reallocate reply message to "
                                  "%u:%llu\n", (unsigned)callers->rd->pnn,
                                  (unsigned long long)callers->rd->srvid));
-               ret = ctdb_send_message(ctdb, callers->rd->pnn, callers->rd->srvid, result);
+               ret = ctdb_client_send_message(ctdb, callers->rd->pnn, callers->rd->srvid, result);
                if (ret != 0) {
                        DEBUG(DEBUG_ERR,("Failed to send ip reallocate reply "
                                         "message to %u:%llu\n",
@@ -2607,7 +2607,7 @@ static int verify_local_ip_allocation(struct ctdb_context *ctdb, struct ctdb_rec
                data.dptr = (uint8_t *)&rd;
                data.dsize = sizeof(rd);
 
-               ret = ctdb_send_message(ctdb, rec->recmaster, CTDB_SRVID_TAKEOVER_RUN, data);
+               ret = ctdb_client_send_message(ctdb, rec->recmaster, CTDB_SRVID_TAKEOVER_RUN, data);
                if (ret != 0) {
                        DEBUG(DEBUG_ERR,(__location__ " Failed to send ipreallocate to recmaster :%d\n", (int)rec->recmaster));
                }
index 580686e2ba3445ec3684ee4dd65b03e3b5f5d680..f1e61dbf115483f1540a23db57578514d5b7d4a0 100644 (file)
@@ -272,7 +272,7 @@ static int ctdb_vacuum_db(struct ctdb_db_context *ctdb_db, struct vacuum_data *v
 
                        data.dsize = talloc_get_size(vdata->list[i]);
                        data.dptr  = (void *)vdata->list[i];
-                       if (ctdb_send_message(ctdb, ctdb->vnn_map->map[i], CTDB_SRVID_VACUUM_FETCH, data) != 0) {
+                       if (ctdb_client_send_message(ctdb, ctdb->vnn_map->map[i], CTDB_SRVID_VACUUM_FETCH, data) != 0) {
                                DEBUG(DEBUG_ERR,(__location__ " Failed to send vacuum fetch message to %u\n",
                                         ctdb->vnn_map->map[i]));
                                return -1;              
index 2c5a6545a6bcc747011991d25fe3ad30e024cd24..294c1efad79b3d71f241eea7f6745df767199328 100644 (file)
@@ -94,7 +94,7 @@ static void ring_message_handler(struct ctdb_context *ctdb, uint64_t srvid,
 
        (*count)++;
        dest = (ctdb_get_pnn(ctdb) + num_nodes + incr) % num_nodes;
-       ctdb_send_message(ctdb, dest, srvid, data);
+       ctdb_client_send_message(ctdb, dest, srvid, data);
        if (incr == 1) {
                msg_plus++;
        } else {
@@ -114,7 +114,7 @@ static void send_start_messages(struct ctdb_context *ctdb, int incr)
        data.dsize = sizeof(incr);
 
        dest = (ctdb_get_pnn(ctdb) + num_nodes + incr) % num_nodes;
-       ctdb_send_message(ctdb, dest, 0, data);
+       ctdb_client_send_message(ctdb, dest, 0, data);
 }
 
 static void each_second(struct event_context *ev, struct timed_event *te, 
index ec53ac9dfe699de9191e1f9ca8c3c6b0a2fcfd89..7fd45dec386fd79935eedcdbea35339912b4d9ad 100644 (file)
@@ -99,7 +99,7 @@ static void bench_fetch_1node(struct ctdb_context *ctdb)
        nulldata.dsize = 0;
 
        dest = (ctdb_get_pnn(ctdb) + 1) % num_nodes;
-       ctdb_send_message(ctdb, dest, 0, nulldata);
+       ctdb_client_send_message(ctdb, dest, 0, nulldata);
 }
 
 /*
index f13ce79379343b1883fcb10dd2719e668de199af..e6dc3fadd6f2f2a7c15295d1d90dd481a326fd93 100644 (file)
@@ -1012,7 +1012,7 @@ static int move_ip(struct ctdb_context *ctdb, ctdb_sock_addr *addr, uint32_t pnn
        disable_time = 30;
        data.dptr  = (uint8_t*)&disable_time;
        data.dsize = sizeof(disable_time);
-       ret = ctdb_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_DISABLE_IP_CHECK, data);
+       ret = ctdb_client_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_DISABLE_IP_CHECK, data);
        if (ret != 0) {
                DEBUG(DEBUG_ERR,("Failed to send message to disable ipcheck\n"));
                return -1;
@@ -1076,7 +1076,7 @@ static int move_ip(struct ctdb_context *ctdb, ctdb_sock_addr *addr, uint32_t pnn
        /* update the recovery daemon so it now knows to expect the new
           node assignment for this ip.
        */
-       ret = ctdb_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_RECD_UPDATE_IP, data);
+       ret = ctdb_client_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_RECD_UPDATE_IP, data);
        if (ret != 0) {
                DEBUG(DEBUG_ERR,("Failed to send message to update the ip on the recovery master.\n"));
                return -1;
@@ -2066,7 +2066,7 @@ again:
        } 
 
        ipreallocate_finished = 0;
-       ret = ctdb_send_message(ctdb, recmaster, CTDB_SRVID_TAKEOVER_RUN, data);
+       ret = ctdb_client_send_message(ctdb, recmaster, CTDB_SRVID_TAKEOVER_RUN, data);
        if (ret != 0) {
                DEBUG(DEBUG_ERR,("Failed to send ip takeover run request message to %u\n", options.pnn));
                return -1;
@@ -4145,7 +4145,7 @@ static int control_rddumpmemory(struct ctdb_context *ctdb, int argc, const char
        data.dptr = (uint8_t *)&rd;
        data.dsize = sizeof(rd);
 
-       ret = ctdb_send_message(ctdb, options.pnn, CTDB_SRVID_MEM_DUMP, data);
+       ret = ctdb_client_send_message(ctdb, options.pnn, CTDB_SRVID_MEM_DUMP, data);
        if (ret != 0) {
                DEBUG(DEBUG_ERR,("Failed to send memdump request message to %u\n", options.pnn));
                return -1;
@@ -4177,7 +4177,7 @@ static int control_msgsend(struct ctdb_context *ctdb, int argc, const char **arg
        data.dptr = (uint8_t *)discard_const(argv[1]);
        data.dsize= strlen(argv[1]);
 
-       ret = ctdb_send_message(ctdb, CTDB_BROADCAST_CONNECTED, srvid, data);
+       ret = ctdb_client_send_message(ctdb, CTDB_BROADCAST_CONNECTED, srvid, data);
        if (ret != 0) {
                DEBUG(DEBUG_ERR,("Failed to send memdump request message to %u\n", options.pnn));
                return -1;
index 315912cc351a2e1dee3256c41bd72368fe7176cd..c761583049511d400863102c48d1e37a16cbc7a9 100644 (file)
@@ -308,7 +308,7 @@ static int ctdb_vacuum_db(struct ctdb_context *ctdb, uint32_t db_id, struct ctdb
 
                        data.dsize = talloc_get_size(vdata->list[i]);
                        data.dptr  = (void *)vdata->list[i];
-                       if (ctdb_send_message(ctdb, ctdb->vnn_map->map[i], CTDB_SRVID_VACUUM_FETCH, data) != 0) {
+                       if (ctdb_client_send_message(ctdb, ctdb->vnn_map->map[i], CTDB_SRVID_VACUUM_FETCH, data) != 0) {
                                DEBUG(DEBUG_ERR,(__location__ " Failed to send vacuum fetch message to %u\n",
                                         ctdb->vnn_map->map[i]));
                                talloc_free(vdata);