1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

client: add ctdb_ctrl_transaction_active() which calls out to CTDB_TRANS2_ACTIVE

Michael

(This used to be ctdb commit 813cfd7c625ac8af4ef169cc92fb6d69f66004c9)
This commit is contained in:
Michael Adam 2009-10-28 22:54:49 +01:00 committed by Ronnie Sahlberg
parent abac42ca34
commit 953ccee5c5

View File

@ -3141,6 +3141,34 @@ int ctdb_ctrl_getcapabilities(struct ctdb_context *ctdb, struct timeval timeout,
return ret;
}
/**
* check whether a transaction is active on a given db on a given node
*/
static int32_t ctdb_ctrl_transaction_active(struct ctdb_context *ctdb,
uint32_t destnode,
uint32_t db_id)
{
int32_t status;
int ret;
TDB_DATA indata;
indata.dptr = (uint8_t *)&db_id;
indata.dsize = sizeof(db_id);
ret = ctdb_control(ctdb, destnode, 0,
CTDB_CONTROL_TRANS2_ACTIVE,
0, indata, NULL, NULL, &status,
NULL, NULL);
if (ret != 0) {
DEBUG(DEBUG_ERR, (__location__ " ctdb control for transaction_active failed\n"));
return -1;
}
return status;
}
struct ctdb_transaction_handle {
struct ctdb_db_context *ctdb_db;
bool in_replay;