From ef3ab7ba1c513860f1698143ae1f42859fb37e56 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 28 Oct 2009 23:56:03 +0100 Subject: [PATCH] s3:dbwrap_ctdb: add new db_ctdb_transaction_active() that calls CTDB_CONTROL_TRANS2_COMMIT Michael Signed-off-by: Michael Adam --- source3/lib/dbwrap_ctdb.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c index 49df62afd30..ec52d766c06 100644 --- a/source3/lib/dbwrap_ctdb.c +++ b/source3/lib/dbwrap_ctdb.c @@ -298,6 +298,27 @@ static struct ctdb_rec_data *db_ctdb_marshall_loop_next(struct ctdb_marshall_buf } +static int32_t db_ctdb_transaction_active(uint32_t db_id) +{ + int32_t status; + NTSTATUS ret; + TDB_DATA indata; + + indata.dptr = (uint8_t *)&db_id; + indata.dsize = sizeof(db_id); + + ret = ctdbd_control_local(messaging_ctdbd_connection(), + CTDB_CONTROL_TRANS2_ACTIVE, 0, 0, + indata, NULL, NULL, &status); + + if (!NT_STATUS_IS_OK(ret)) { + DEBUG(2, ("ctdb control TRANS2_ACTIVE failed\n")); + return -1; + } + + return status; +} + /** * CTDB transaction destructor -- 2.11.4.GIT