1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-26 01:49:31 +03:00

ctdb-client: Add sync api for DB_ATTACH_REPLICATED control

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs
2017-06-26 15:55:15 +10:00
committed by Martin Schwenke
parent b783b930de
commit b1b6ceeced
2 changed files with 36 additions and 0 deletions

View File

@ -2728,3 +2728,33 @@ int ctdb_ctrl_db_open_flags(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
return 0;
}
int ctdb_ctrl_db_attach_replicated(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct ctdb_client_context *client,
int destnode, struct timeval timeout,
const char *db_name, uint32_t *db_id)
{
struct ctdb_req_control request;
struct ctdb_reply_control *reply;
int ret;
ctdb_req_control_db_attach_replicated(&request, db_name);
ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout,
&request, &reply);
if (ret != 0) {
DEBUG(DEBUG_ERR,
("Control DB_ATTACH_REPLICATED failed to node %u,"
" ret=%d\n", destnode, ret));
return ret;
}
ret = ctdb_reply_control_db_attach_replicated(reply, db_id);
if (ret != 0) {
DEBUG(DEBUG_ERR,
("Control DB_ATTACH_REPLICATED failed, ret=%d\n", ret));
return ret;
}
return 0;
}

View File

@ -488,6 +488,12 @@ int ctdb_ctrl_db_open_flags(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
int destnode, struct timeval timeout,
uint32_t db_id, int *tdb_flags);
int ctdb_ctrl_db_attach_replicated(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct ctdb_client_context *client,
int destnode, struct timeval timeout,
const char *db_name, uint32_t *db_id);
/* from client/client_message_sync.c */
int ctdb_message_recd_update_ip(TALLOC_CTX *mem_ctx, struct tevent_context *ev,