ctdb-protocol: Drop marshalling code for CHECK_SRVIDS control
authorAmitay Isaacs <amitay@gmail.com>
Fri, 4 Aug 2017 04:27:26 +0000 (14:27 +1000)
committerMartin Schwenke <martins@samba.org>
Mon, 14 Aug 2017 07:01:22 +0000 (09:01 +0200)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/protocol/protocol_api.h
ctdb/protocol/protocol_client.c
ctdb/protocol/protocol_control.c
ctdb/tests/src/protocol_client_test.c

index a8875446a7cfc41c6213d12e2b6af066410d6c5b..75ded4f350bdbdb37f873815941d833a0537cb89 100644 (file)
@@ -517,12 +517,6 @@ void ctdb_req_control_set_db_readonly(struct ctdb_req_control *request,
                                      uint32_t db_id);
 int ctdb_reply_control_set_db_readonly(struct ctdb_reply_control *reply);
 
-void ctdb_req_control_check_srvids(struct ctdb_req_control *request,
-                                  struct ctdb_uint64_array *u64_array);
-int ctdb_reply_control_check_srvids(struct ctdb_reply_control *reply,
-                                   TALLOC_CTX *mem_ctx,
-                                   struct ctdb_uint8_array **u8_array);
-
 void ctdb_req_control_traverse_start_ext(struct ctdb_req_control *request,
                                         struct ctdb_traverse_start_ext *traverse);
 int ctdb_reply_control_traverse_start_ext(struct ctdb_reply_control *reply);
index daa70cc513b06a0904557737be7b054bdbc29ad4..dbe13d0be79a4eb907cf6104025d1ff038dbfe08 100644 (file)
@@ -1915,33 +1915,6 @@ int ctdb_reply_control_set_db_readonly(struct ctdb_reply_control *reply)
 
 /* CTDB_CONTROL_CHECK_SRVIDS */
 
-void ctdb_req_control_check_srvids(struct ctdb_req_control *request,
-                                  struct ctdb_uint64_array *u64_array)
-{
-       request->opcode = CTDB_CONTROL_CHECK_SRVIDS;
-       request->pad = 0;
-       request->srvid = 0;
-       request->client_id = 0;
-       request->flags = 0;
-
-       request->rdata.opcode = CTDB_CONTROL_CHECK_SRVIDS;
-       request->rdata.data.u64_array = u64_array;
-}
-
-int ctdb_reply_control_check_srvids(struct ctdb_reply_control *reply,
-                                   TALLOC_CTX *mem_ctx,
-                                   struct ctdb_uint8_array **u8_array)
-{
-       if (reply->rdata.opcode != CTDB_CONTROL_CHECK_SRVIDS) {
-               return EPROTO;
-       }
-
-       if (reply->status == 0) {
-               *u8_array = talloc_steal(mem_ctx, reply->rdata.data.u8_array);
-       }
-       return reply->status;
-}
-
 /* CTDB_CONTROL_TRAVERSE_START_EXT */
 
 void ctdb_req_control_traverse_start_ext(struct ctdb_req_control *request,
index 3c5c7ce93cfd6b20912315930891a84a877d9d5f..b999d79d1ea60b390fb7d598c955270df9e70976 100644 (file)
@@ -356,7 +356,6 @@ static size_t ctdb_req_control_data_len(struct ctdb_req_control_data *cd)
                break;
 
        case CTDB_CONTROL_CHECK_SRVIDS:
-               len = ctdb_uint64_array_len(cd->data.u64_array);
                break;
 
        case CTDB_CONTROL_TRAVERSE_START_EXT:
@@ -639,7 +638,6 @@ static void ctdb_req_control_data_push(struct ctdb_req_control_data *cd,
                break;
 
        case CTDB_CONTROL_CHECK_SRVIDS:
-               ctdb_uint64_array_push(cd->data.u64_array, buf);
                break;
 
        case CTDB_CONTROL_TRAVERSE_START_EXT:
@@ -962,8 +960,6 @@ static int ctdb_req_control_data_pull(uint8_t *buf, size_t buflen,
                break;
 
        case CTDB_CONTROL_CHECK_SRVIDS:
-               ret = ctdb_uint64_array_pull(buf, buflen, mem_ctx,
-                                            &cd->data.u64_array);
                break;
 
        case CTDB_CONTROL_TRAVERSE_START_EXT:
@@ -1344,7 +1340,6 @@ static size_t ctdb_reply_control_data_len(struct ctdb_reply_control_data *cd)
                break;
 
        case CTDB_CONTROL_CHECK_SRVIDS:
-               len = ctdb_uint8_array_len(cd->data.u8_array);
                break;
 
        case CTDB_CONTROL_TRAVERSE_START_EXT:
@@ -1540,7 +1535,6 @@ static void ctdb_reply_control_data_push(struct ctdb_reply_control_data *cd,
                break;
 
        case CTDB_CONTROL_CHECK_SRVIDS:
-               ctdb_uint8_array_push(cd->data.u8_array, buf);
                break;
 
        case CTDB_CONTROL_GET_DB_STATISTICS:
@@ -1728,8 +1722,6 @@ static int ctdb_reply_control_data_pull(uint8_t *buf, size_t buflen,
                break;
 
        case CTDB_CONTROL_CHECK_SRVIDS:
-               ret = ctdb_uint8_array_pull(buf, buflen, mem_ctx,
-                                           &cd->data.u8_array);
                break;
 
        case CTDB_CONTROL_GET_DB_STATISTICS:
index e34879fd601a32e2d40a8e870693ae05108e8150..464ba1c207d4fc781bcc015de63574c2d6cf20a5 100644 (file)
@@ -505,9 +505,6 @@ static void fill_ctdb_req_control_data(TALLOC_CTX *mem_ctx,
                break;
 
        case CTDB_CONTROL_CHECK_SRVIDS:
-               cd->data.u64_array = talloc(mem_ctx, struct ctdb_uint64_array);
-               assert(cd->data.u64_array != NULL);
-               fill_ctdb_uint64_array(mem_ctx, cd->data.u64_array);
                break;
 
        case CTDB_CONTROL_TRAVERSE_START_EXT:
@@ -920,8 +917,6 @@ static void verify_ctdb_req_control_data(struct ctdb_req_control_data *cd,
                break;
 
        case CTDB_CONTROL_CHECK_SRVIDS:
-               verify_ctdb_uint64_array(cd->data.u64_array,
-                                        cd2->data.u64_array);
                break;
 
        case CTDB_CONTROL_TRAVERSE_START_EXT:
@@ -1359,9 +1354,6 @@ static void fill_ctdb_reply_control_data(TALLOC_CTX *mem_ctx,
                break;
 
        case CTDB_CONTROL_CHECK_SRVIDS:
-               cd->data.u8_array = talloc(mem_ctx, struct ctdb_uint8_array);
-               assert(cd->data.u8_array != NULL);
-               fill_ctdb_uint8_array(mem_ctx, cd->data.u8_array);
                break;
 
        case CTDB_CONTROL_TRAVERSE_START_EXT:
@@ -1713,7 +1705,6 @@ static void verify_ctdb_reply_control_data(struct ctdb_reply_control_data *cd,
                break;
 
        case CTDB_CONTROL_CHECK_SRVIDS:
-               verify_ctdb_uint8_array(cd->data.u8_array, cd2->data.u8_array);
                break;
 
        case CTDB_CONTROL_TRAVERSE_START_EXT: