From: Amitay Isaacs Date: Fri, 4 Aug 2017 04:27:26 +0000 (+1000) Subject: ctdb-protocol: Drop marshalling code for CHECK_SRVIDS control X-Git-Tag: tdb-1.3.15~97 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=66694d89262acd9ce4ed50df935f7ac4b39ae7c9;p=thirdparty%2Fsamba.git ctdb-protocol: Drop marshalling code for CHECK_SRVIDS control Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- diff --git a/ctdb/protocol/protocol_api.h b/ctdb/protocol/protocol_api.h index a8875446a7c..75ded4f350b 100644 --- a/ctdb/protocol/protocol_api.h +++ b/ctdb/protocol/protocol_api.h @@ -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); diff --git a/ctdb/protocol/protocol_client.c b/ctdb/protocol/protocol_client.c index daa70cc513b..dbe13d0be79 100644 --- a/ctdb/protocol/protocol_client.c +++ b/ctdb/protocol/protocol_client.c @@ -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, diff --git a/ctdb/protocol/protocol_control.c b/ctdb/protocol/protocol_control.c index 3c5c7ce93cf..b999d79d1ea 100644 --- a/ctdb/protocol/protocol_control.c +++ b/ctdb/protocol/protocol_control.c @@ -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: diff --git a/ctdb/tests/src/protocol_client_test.c b/ctdb/tests/src/protocol_client_test.c index e34879fd601..464ba1c207d 100644 --- a/ctdb/tests/src/protocol_client_test.c +++ b/ctdb/tests/src/protocol_client_test.c @@ -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: