summaryrefslogtreecommitdiffstats
path: root/ctdb/include/ctdb.h
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2011-10-28 12:10:38 +1100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2011-10-28 12:10:38 +1100
commite7cdc3cd4ccce97ad956b0c341eb01d38aa9db2b (patch)
tree94c0e27b1076623a2760beed244a58ad9c5125ce /ctdb/include/ctdb.h
parent26aee76add311c43399b90c3d913226ea2feff3b (diff)
parentc21ec9fffc6f25081cdf008e3051e81710a38125 (diff)
downloadsamba-e7cdc3cd4ccce97ad956b0c341eb01d38aa9db2b.tar.gz
samba-e7cdc3cd4ccce97ad956b0c341eb01d38aa9db2b.tar.xz
samba-e7cdc3cd4ccce97ad956b0c341eb01d38aa9db2b.zip
Merge branch 'master' of 10.1.1.27:/shared/ctdb/ctdb-master
(This used to be ctdb commit 0452f212f2ddc1089dce83339bad0d73763f238f)
Diffstat (limited to 'ctdb/include/ctdb.h')
-rw-r--r--ctdb/include/ctdb.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/ctdb/include/ctdb.h b/ctdb/include/ctdb.h
index 4cdbc0f76a..35ccf83e32 100644
--- a/ctdb/include/ctdb.h
+++ b/ctdb/include/ctdb.h
@@ -315,6 +315,24 @@ bool ctdb_readrecordlock_async(struct ctdb_db *ctdb_db, TDB_DATA key,
ctdb_rrl_callback_t callback, void *cbdata);
/**
+ * ctdb_readonlyrecordlock_async - read and lock a record for read-only access
+ * @ctdb_db: the database handle from ctdb_attachdb/ctdb_attachdb_recv.
+ * @key: the key of the record to lock.
+ * @callback: the callback once the record is locked (typesafe).
+ * @cbdata: the argument to callback()
+ *
+ * This returns true on success. Commonly, we can obtain the record
+ * immediately and so the callback will be invoked. Otherwise a request
+ * will be queued to ctdbd for the record.
+ *
+ * If failure is immediate, false is returned. Otherwise, the callback
+ * may receive a NULL lock arg to indicate asynchronous failure.
+ */
+bool ctdb_readonlyrecordlock_async(struct ctdb_db *ctdb_db, TDB_DATA key,
+ ctdb_rrl_callback_t callback, void *cbdata);
+
+
+/**
* ctdb_writerecord - write a locked record in a TDB
* @ctdb_db: the database handle from ctdb_attachdb/ctdb_attachdb_recv.
* @lock: the lock from ctdb_readrecordlock/ctdb_readrecordlock_recv