ctdb-client: Add sync api for control DB_OPEN_FLAGS
authorAmitay Isaacs <amitay@gmail.com>
Wed, 14 Jun 2017 06:37:34 +0000 (16:37 +1000)
committerMartin Schwenke <martins@samba.org>
Mon, 26 Jun 2017 13:47:24 +0000 (15:47 +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

index 3b44c2ffe5132f690d90b992ef9893a2b1ed4dd8..7e245b6333319303d0bc1b3fea90ef2e6c884838 100644 (file)
@@ -2701,3 +2701,32 @@ int ctdb_ctrl_db_push_confirm(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
 
        return 0;
 }
+
+int ctdb_ctrl_db_open_flags(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
+                           struct ctdb_client_context *client,
+                           int destnode, struct timeval timeout,
+                           uint32_t db_id, int *tdb_flags)
+{
+       struct ctdb_req_control request;
+       struct ctdb_reply_control *reply;
+       int ret;
+
+       ctdb_req_control_db_open_flags(&request, db_id);
+       ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout,
+                                 &request, &reply);
+       if (ret != 0) {
+               DEBUG(DEBUG_ERR,
+                     ("Control DB_OPEN_FLAGS failed to node %u, ret=%d\n",
+                      destnode, ret));
+               return ret;
+       }
+
+       ret = ctdb_reply_control_db_open_flags(reply, tdb_flags);
+       if (ret != 0) {
+               DEBUG(DEBUG_ERR,
+                     ("Control DB_OPEN_FLAGS failed, ret=%d\n", ret));
+               return ret;
+       }
+
+       return 0;
+}
index 8c94f12ee0e3ebc3bb35fd5efebf54a095291242..18387eee47da5eb1f99e00dfbfc0510b85f76db3 100644 (file)
@@ -485,6 +485,11 @@ int ctdb_ctrl_db_push_confirm(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                              int destnode, struct timeval timeout,
                              uint32_t db_id, uint32_t *num_records);
 
+int ctdb_ctrl_db_open_flags(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
+                           struct ctdb_client_context *client,
+                           int destnode, struct timeval timeout,
+                           uint32_t db_id, int *tdb_flags);
+
 /* from client/client_message_sync.c */
 
 int ctdb_message_recd_update_ip(TALLOC_CTX *mem_ctx, struct tevent_context *ev,