From: Amitay Isaacs Date: Thu, 21 Jul 2016 02:47:16 +0000 (+1000) Subject: ctdb-client: Reimplement ctdb_ctrl_freeze_priority() using ctdb_control() X-Git-Tag: tdb-1.3.10~135 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0e0331af855efaf57e2e8339db15e9f5d13f8bff;p=thirdparty%2Fsamba.git ctdb-client: Reimplement ctdb_ctrl_freeze_priority() using ctdb_control() This makes it easier to drop unused async implementation of the same. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index d1b622574ea..80f6b2affbe 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -2459,17 +2459,22 @@ int ctdb_ctrl_freeze_recv(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct /* freeze databases of a certain priority */ -int ctdb_ctrl_freeze_priority(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t priority) +int ctdb_ctrl_freeze_priority(struct ctdb_context *ctdb, + struct timeval timeout, + uint32_t destnode, uint32_t priority) { - TALLOC_CTX *tmp_ctx = talloc_new(ctdb); - struct ctdb_client_control_state *state; int ret; + int32_t res; - state = ctdb_ctrl_freeze_send(ctdb, tmp_ctx, timeout, destnode, priority); - ret = ctdb_ctrl_freeze_recv(ctdb, tmp_ctx, state); - talloc_free(tmp_ctx); + ret = ctdb_control(ctdb, destnode, priority, + CTDB_CONTROL_FREEZE, 0, tdb_null, + NULL, NULL, &res, &timeout, NULL); + if (ret != 0 || res != 0) { + DEBUG(DEBUG_ERR, ("ctdb_ctrl_freeze_priority failed\n")); + return -1; + } - return ret; + return 0; } /* Freeze all databases */