ctdb-daemon: Rename struct ctdb_server_id to ctdb_client_id
authorAmitay Isaacs <amitay@gmail.com>
Wed, 28 Oct 2015 06:47:03 +0000 (17:47 +1100)
committerMartin Schwenke <martins@samba.org>
Tue, 3 Nov 2015 23:47:15 +0000 (00:47 +0100)
This is to avoid clash with samba structure server_id.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/client/ctdb_client.c
ctdb/include/ctdb_client.h
ctdb/include/ctdb_protocol.h
ctdb/server/ctdb_control.c
ctdb/server/ctdb_serverids.c
ctdb/tools/ctdb.c

index 407eefd8155744e1cb86453242fcad366600d71e..cc96eb57fd614ccdf1a1b0548135ccd3ba28acfa 100644 (file)
@@ -3205,15 +3205,15 @@ int ctdb_ctrl_get_tcp_tickles(struct ctdb_context *ctdb,
 /*
   register a server id
  */
-int ctdb_ctrl_register_server_id(struct ctdb_context *ctdb, 
-                     struct timeval timeout, 
-                     struct ctdb_server_id *id)
+int ctdb_ctrl_register_server_id(struct ctdb_context *ctdb,
+                                struct timeval timeout,
+                                struct ctdb_client_id *id)
 {
        TDB_DATA data;
        int32_t res;
        int ret;
 
-       data.dsize = sizeof(struct ctdb_server_id);
+       data.dsize = sizeof(struct ctdb_client_id);
        data.dptr  = (unsigned char *)id;
 
        ret = ctdb_control(ctdb, CTDB_CURRENT_NODE, 0, 
@@ -3231,15 +3231,15 @@ int ctdb_ctrl_register_server_id(struct ctdb_context *ctdb,
 /*
   unregister a server id
  */
-int ctdb_ctrl_unregister_server_id(struct ctdb_context *ctdb, 
-                     struct timeval timeout, 
-                     struct ctdb_server_id *id)
+int ctdb_ctrl_unregister_server_id(struct ctdb_context *ctdb,
+                                  struct timeval timeout,
+                                  struct ctdb_client_id *id)
 {
        TDB_DATA data;
        int32_t res;
        int ret;
 
-       data.dsize = sizeof(struct ctdb_server_id);
+       data.dsize = sizeof(struct ctdb_client_id);
        data.dptr  = (unsigned char *)id;
 
        ret = ctdb_control(ctdb, CTDB_CURRENT_NODE, 0, 
@@ -3260,17 +3260,15 @@ int ctdb_ctrl_unregister_server_id(struct ctdb_context *ctdb,
 
   if a server id does exist, return *status == 1, otherwise *status == 0
  */
-int ctdb_ctrl_check_server_id(struct ctdb_context *ctdb, 
-                     struct timeval timeout, 
-                     uint32_t destnode,
-                     struct ctdb_server_id *id,
-                     uint32_t *status)
+int ctdb_ctrl_check_server_id(struct ctdb_context *ctdb,
+                             struct timeval timeout, uint32_t destnode,
+                             struct ctdb_client_id *id, uint32_t *status)
 {
        TDB_DATA data;
        int32_t res;
        int ret;
 
-       data.dsize = sizeof(struct ctdb_server_id);
+       data.dsize = sizeof(struct ctdb_client_id);
        data.dptr  = (unsigned char *)id;
 
        ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_CHECK_SERVER_ID, 
@@ -3874,7 +3872,7 @@ static bool ctdb_server_id_equal(struct server_id *id1, struct server_id *id2)
 
 static bool server_id_exists(struct ctdb_context *ctdb, struct server_id *id)
 {
-       struct ctdb_server_id sid;
+       struct ctdb_client_id sid;
        int ret;
        uint32_t result = 0;
 
@@ -4135,7 +4133,7 @@ struct ctdb_transaction_handle *ctdb_transaction_start(struct ctdb_db_context *c
                                                       TALLOC_CTX *mem_ctx)
 {
        struct ctdb_transaction_handle *h;
-       struct ctdb_server_id id;
+       struct ctdb_client_id id;
 
        h = talloc_zero(mem_ctx, struct ctdb_transaction_handle);
        if (h == NULL) {
index 5e43347c712ac4ab57ea2a843564d28a16a92969..d5ca55b36408a12c960bbe709c7c629f9b820730 100644 (file)
@@ -421,13 +421,13 @@ int ctdb_ctrl_get_tcp_tickles(struct ctdb_context *ctdb,
 
 int ctdb_ctrl_register_server_id(struct ctdb_context *ctdb,
                                 struct timeval timeout,
-                                struct ctdb_server_id *id);
+                                struct ctdb_client_id *id);
 int ctdb_ctrl_unregister_server_id(struct ctdb_context *ctdb,
                                   struct timeval timeout,
-                                  struct ctdb_server_id *id);
+                                  struct ctdb_client_id *id);
 int ctdb_ctrl_check_server_id(struct ctdb_context *ctdb,
                              struct timeval timeout, uint32_t destnode,
-                             struct ctdb_server_id *id, uint32_t *status);
+                             struct ctdb_client_id *id, uint32_t *status);
 int ctdb_ctrl_get_server_id_list(struct ctdb_context *ctdb,
                                 TALLOC_CTX *mem_ctx,
                                 struct timeval timeout, uint32_t destnode,
index 1970a38c5b1abc16bf4c0aedf2577670ef6fc896..9accc587368f3dd4145fe3f48e70b0a205e67f29 100644 (file)
@@ -790,7 +790,7 @@ enum ctdb_client_id_type {
        SERVER_TYPE_ISCSID=3
 };
 
-struct ctdb_server_id {
+struct ctdb_client_id {
        enum ctdb_client_id_type type;
        uint32_t pnn;
        uint32_t server_id;
@@ -798,7 +798,7 @@ struct ctdb_server_id {
 
 struct ctdb_server_id_list {
        uint32_t num;
-       struct ctdb_server_id server_ids[1];
+       struct ctdb_client_id server_ids[1];
 };
 
 struct ctdb_uptime {
index 3cdf4ef28b4b1d71b34caa4b4eebea57ef1d53cb..802289f31ced733e3e5debcf25c72c8defe0a8b3 100644 (file)
@@ -420,15 +420,15 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
                return ctdb_control_set_tcp_tickle_list(ctdb, indata);
 
        case CTDB_CONTROL_REGISTER_SERVER_ID: 
-               CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_server_id));
+               CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_client_id));
                return ctdb_control_register_server_id(ctdb, client_id, indata);
 
        case CTDB_CONTROL_UNREGISTER_SERVER_ID: 
-               CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_server_id));
+               CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_client_id));
                return ctdb_control_unregister_server_id(ctdb, indata);
 
        case CTDB_CONTROL_CHECK_SERVER_ID: 
-               CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_server_id));
+               CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_client_id));
                return ctdb_control_check_server_id(ctdb, indata);
 
        case CTDB_CONTROL_GET_SERVER_ID_LIST:
index 80878fe1701f08ce70027180c916e365a8f24499..fd8738ae0e41bd364624969461e91089df8d4ec9 100644 (file)
@@ -32,7 +32,7 @@
 
 
 #define SERVER_ID_KEY_SIZE 3
-static uint32_t *get_server_id_key(struct ctdb_server_id *server_id)
+static uint32_t *get_server_id_key(struct ctdb_client_id *server_id)
 {
        static uint32_t key[SERVER_ID_KEY_SIZE];
 
@@ -67,7 +67,7 @@ int32_t ctdb_control_register_server_id(struct ctdb_context *ctdb,
                                 uint32_t client_id,
                                 TDB_DATA indata)
 {
-       struct ctdb_server_id *server_id;
+       struct ctdb_client_id *server_id;
        struct ctdb_client *client = reqid_find(ctdb->idr, client_id, struct ctdb_client);
 
 
@@ -82,9 +82,9 @@ int32_t ctdb_control_register_server_id(struct ctdb_context *ctdb,
           when the structure is free'd it will be automatically
           removed from the tree
        */
-       server_id = talloc_zero(client, struct ctdb_server_id);
+       server_id = talloc_zero(client, struct ctdb_client_id);
        CTDB_NO_MEMORY(ctdb, server_id);
-       memcpy(server_id, indata.dptr, sizeof(struct ctdb_server_id));
+       memcpy(server_id, indata.dptr, sizeof(struct ctdb_client_id));
 
        trbt_insertarray32_callback(ctdb->server_ids, SERVER_ID_KEY_SIZE,
                get_server_id_key(server_id), 
@@ -100,7 +100,7 @@ int32_t ctdb_control_register_server_id(struct ctdb_context *ctdb,
 int32_t ctdb_control_check_server_id(struct ctdb_context *ctdb, 
                                 TDB_DATA indata)
 {
-       struct ctdb_server_id *server_id = (struct ctdb_server_id *)indata.dptr;
+       struct ctdb_client_id *server_id = (struct ctdb_client_id *)indata.dptr;
 
        return trbt_lookuparray32(ctdb->server_ids, 
                                  SERVER_ID_KEY_SIZE,
@@ -113,7 +113,7 @@ int32_t ctdb_control_check_server_id(struct ctdb_context *ctdb,
 int32_t ctdb_control_unregister_server_id(struct ctdb_context *ctdb, 
                                 TDB_DATA indata)
 {
-       struct ctdb_server_id *server_id = (struct ctdb_server_id *)indata.dptr;
+       struct ctdb_client_id *server_id = (struct ctdb_client_id *)indata.dptr;
 
        talloc_free(trbt_lookuparray32(ctdb->server_ids, 
                        SERVER_ID_KEY_SIZE,
@@ -147,8 +147,8 @@ static int server_id_store(void *param, void *data)
 {
        struct count_server_ids *svid = talloc_get_type(param, 
                                                struct count_server_ids);
-       struct ctdb_server_id *server_id = talloc_get_type(data, 
-                                               struct ctdb_server_id);
+       struct ctdb_client_id *server_id = talloc_get_type(data,
+                                               struct ctdb_client_id);
 
        if (svid == NULL) {
                DEBUG(DEBUG_ERR, (__location__ " Got null pointer for svid\n"));
@@ -160,7 +160,7 @@ static int server_id_store(void *param, void *data)
                return -1;
        }
 
-       memcpy(&svid->list->server_ids[svid->count], server_id, sizeof(struct ctdb_server_id));
+       memcpy(&svid->list->server_ids[svid->count], server_id, sizeof(struct ctdb_client_id));
        svid->count++;
        return 0;
 }
@@ -184,7 +184,7 @@ int32_t ctdb_control_get_server_id_list(struct ctdb_context *ctdb, TDB_DATA *out
 
        outdata->dsize = offsetof(struct ctdb_server_id_list, 
                                server_ids)
-                       + sizeof(struct ctdb_server_id) * svid->count;
+                       + sizeof(struct ctdb_client_id) * svid->count;
        outdata->dptr  = talloc_size(outdata, outdata->dsize);
        CTDB_NO_MEMORY(ctdb, outdata->dptr);
 
index d33ea2a22c9329700f7691437b816a23f75dad4f..62577d9840907426bf015a345fe24c25de7961c0 100644 (file)
@@ -2788,7 +2788,7 @@ static int control_gratious_arp(struct ctdb_context *ctdb, int argc, const char
 static int regsrvid(struct ctdb_context *ctdb, int argc, const char **argv)
 {
        int ret;
-       struct ctdb_server_id server_id;
+       struct ctdb_client_id server_id;
 
        if (argc < 3) {
                usage();
@@ -2814,7 +2814,7 @@ static int regsrvid(struct ctdb_context *ctdb, int argc, const char **argv)
 static int unregsrvid(struct ctdb_context *ctdb, int argc, const char **argv)
 {
        int ret;
-       struct ctdb_server_id server_id;
+       struct ctdb_client_id server_id;
 
        if (argc < 3) {
                usage();
@@ -2839,7 +2839,7 @@ static int chksrvid(struct ctdb_context *ctdb, int argc, const char **argv)
 {
        uint32_t status = 0;
        int ret;
-       struct ctdb_server_id server_id;
+       struct ctdb_client_id server_id;
 
        if (argc < 3) {
                usage();