ctdb-client: Drop client code to send CHECK_SRVIDS control
authorAmitay Isaacs <amitay@gmail.com>
Fri, 4 Aug 2017 04:25:04 +0000 (14:25 +1000)
committerMartin Schwenke <martins@samba.org>
Mon, 14 Aug 2017 07:01:21 +0000 (09:01 +0200)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/client/client_control_sync.c
ctdb/client/client_sync.h
ctdb/client/ctdb_client.c
ctdb/include/ctdb_client.h

index 43a941d79dba302832e159424a8f75ba24f350f2..fd31823885c2bd676ef30a6ba2868a1d9551b67f 100644 (file)
@@ -2194,48 +2194,6 @@ int ctdb_ctrl_set_db_readonly(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
        return 0;
 }
 
-int ctdb_ctrl_check_srvids(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
-                          struct ctdb_client_context *client,
-                          int destnode, struct timeval timeout,
-                          uint64_t *srvid, int count, uint8_t **result)
-{
-       struct ctdb_uint64_array srvid_list;
-       struct ctdb_uint8_array *u8_array;
-       struct ctdb_req_control request;
-       struct ctdb_reply_control *reply;
-       int ret;
-
-       srvid_list.num = count;
-       srvid_list.val = srvid;
-
-       ctdb_req_control_check_srvids(&request, &srvid_list);
-       ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout,
-                                 &request, &reply);
-       if (ret != 0) {
-               DEBUG(DEBUG_ERR,
-                     ("Control CHECK_SRVIDS failed to node %u, ret=%d\n",
-                      destnode, ret));
-               return ret;
-       }
-
-       ret = ctdb_reply_control_check_srvids(reply, &request, &u8_array);
-       if (ret != 0) {
-               DEBUG(DEBUG_ERR,
-                     ("Control CHECK_SRVIDS failed, ret=%d\n", ret));
-               return ret;
-       }
-
-       if (u8_array->num != count) {
-               DEBUG(DEBUG_ERR,
-                     ("Control CHECK_SRVIDS returned invalid data %d != %d\n",
-                      u8_array->num, count));
-               return ret;
-       }
-
-       *result = talloc_steal(mem_ctx, u8_array->val);
-       return 0;
-}
-
 int ctdb_ctrl_traverse_start_ext(TALLOC_CTX *mem_ctx,
                                 struct tevent_context *ev,
                                 struct ctdb_client_context *client,
index a4b5c49ab0b717946c6a1494ce05b9b0dd802030..ceda00f030496ebe5c9e4b121c3a7c5bb21cb17c 100644 (file)
@@ -397,11 +397,6 @@ int ctdb_ctrl_set_db_readonly(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                              int destnode, struct timeval timeout,
                              uint32_t db_id);
 
-int ctdb_ctrl_check_srvids(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
-                          struct ctdb_client_context *client,
-                          int destnode, struct timeval timeout,
-                          uint64_t *srvid, int count, uint8_t **result);
-
 int ctdb_ctrl_traverse_start_ext(TALLOC_CTX *mem_ctx,
                                 struct tevent_context *ev,
                                 struct ctdb_client_context *client,
index 5ec3d0043f3dd3943f8bc4c44bd11334cd44fc01..47f99bc08b53cf9e2b957cad317acbd1639e5e7b 100644 (file)
@@ -558,43 +558,6 @@ int ctdb_client_remove_message_handler(struct ctdb_context *ctdb,
        return 0;
 }
 
-/*
- * check server ids
- */
-int ctdb_client_check_message_handlers(struct ctdb_context *ctdb, uint64_t *ids, uint32_t num,
-                                      uint8_t *result)
-{
-       TDB_DATA indata, outdata;
-       int res;
-       int32_t status;
-       int i;
-
-       indata.dptr = (uint8_t *)ids;
-       indata.dsize = num * sizeof(*ids);
-
-       res = ctdb_control(ctdb, CTDB_CURRENT_NODE, 0, CTDB_CONTROL_CHECK_SRVIDS, 0,
-                          indata, ctdb, &outdata, &status, NULL, NULL);
-       if (res != 0 || status != 0) {
-               DEBUG(DEBUG_ERR, (__location__ " failed to check srvids\n"));
-               return -1;
-       }
-
-       if (outdata.dsize != num*sizeof(uint8_t)) {
-               DEBUG(DEBUG_ERR, (__location__ " expected %lu bytes, received %zi bytes\n",
-                                 (long unsigned int)num*sizeof(uint8_t),
-                                 outdata.dsize));
-               talloc_free(outdata.dptr);
-               return -1;
-       }
-
-       for (i=0; i<num; i++) {
-               result[i] = outdata.dptr[i];
-       }
-
-       talloc_free(outdata.dptr);
-       return 0;
-}
-
 /*
   send a message - from client context
  */
index d4fd77142ecfde6fe7bbbccf89db04126504cdca..329e3544ab617123a034f9b7bc88bb0128cc46e6 100644 (file)
@@ -95,9 +95,6 @@ int ctdb_client_set_message_handler(struct ctdb_context *ctdb, uint64_t srvid,
                                    void *private_data);
 int ctdb_client_remove_message_handler(struct ctdb_context *ctdb,
                                       uint64_t srvid, void *private_data);
-int ctdb_client_check_message_handlers(struct ctdb_context *ctdb,
-                                      uint64_t *ids, uint32_t num,
-                                      uint8_t *result);
 
 /* send a ctdb message */
 int ctdb_client_send_message(struct ctdb_context *ctdb, uint32_t pnn,