tdb: expose transaction lock infrastructure for ctdb
[sahlberg/ctdb.git] / lib / tdb / include / tdb.h
index e7ba9ae3e5483de9f76d8e8fd376dc25c9a2b118..536a0b373722347c6322504ca787cb196e91ca45 100644 (file)
@@ -55,6 +55,7 @@ extern "C" {
 #define TDB_VOLATILE   256 /* Activate the per-hashchain freelist, default 5 */
 #define TDB_ALLOW_NESTING 512 /* Allow transactions to nest */
 #define TDB_DISALLOW_NESTING 1024 /* Disallow transactions to nest */
+#define TDB_INCOMPATIBLE_HASH 2048 /* Better hashing: can't be opened by tdb < 1.2.6. */
 
 /* error codes */
 enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK, 
@@ -160,6 +161,10 @@ _PUBLIC_ int tdb_chainlock_read(struct tdb_context *tdb, TDB_DATA key);
 _PUBLIC_ int tdb_chainunlock_read(struct tdb_context *tdb, TDB_DATA key);
 _PUBLIC_ int tdb_chainlock_mark(struct tdb_context *tdb, TDB_DATA key);
 _PUBLIC_ int tdb_chainlock_unmark(struct tdb_context *tdb, TDB_DATA key);
+_PUBLIC_ int tdb_transaction_write_lock(struct tdb_context *tdb);
+_PUBLIC_ int tdb_transaction_write_unlock(struct tdb_context *tdb);
+_PUBLIC_ int tdb_transaction_write_lock_mark(struct tdb_context *tdb);
+_PUBLIC_ int tdb_transaction_write_lock_unmark(struct tdb_context *tdb);
 
 _PUBLIC_ void tdb_setalarm_sigptr(struct tdb_context *tdb, volatile sig_atomic_t *sigptr);