From 9be4d3dd4f46f0fbd4e20ec33bae7f2e23dba2fd Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 28 Oct 2009 23:56:03 +0100 Subject: s3:dbwrap_ctdb: add new db_ctdb_transaction_active() that calls CTDB_CONTROL_TRANS2_COMMIT Michael --- source3/lib/dbwrap_ctdb.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source3') diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c index 49df62afd3..ec52d766c0 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 -- cgit