diff options
author | Michael Adam <obnox@samba.org> | 2009-10-28 23:56:03 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-11-03 01:02:37 +0100 |
commit | 9be4d3dd4f46f0fbd4e20ec33bae7f2e23dba2fd (patch) | |
tree | 46c454405f1ffe20019e6e958e03657fe92888fe /source3/lib | |
parent | 9bd6b9d9f6591d3f5138c2a831340a88a5e4de5a (diff) | |
download | samba-9be4d3dd4f46f0fbd4e20ec33bae7f2e23dba2fd.tar.gz samba-9be4d3dd4f46f0fbd4e20ec33bae7f2e23dba2fd.tar.bz2 samba-9be4d3dd4f46f0fbd4e20ec33bae7f2e23dba2fd.zip |
s3:dbwrap_ctdb: add new db_ctdb_transaction_active() that calls CTDB_CONTROL_TRANS2_COMMIT
Michael
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/dbwrap_ctdb.c | 21 |
1 files changed, 21 insertions, 0 deletions
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 |