summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-08-24 02:38:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:02:29 -0500
commita87df7009e336f39aa26ae51c9202321663dcb10 (patch)
treeee33f955d27a23c15a940514a93addc5963dcce2
parentfe5124e38d8fbc271a3b5553f54dd6ecd33cf7c7 (diff)
downloadsamba-a87df7009e336f39aa26ae51c9202321663dcb10.tar.gz
samba-a87df7009e336f39aa26ae51c9202321663dcb10.tar.bz2
samba-a87df7009e336f39aa26ae51c9202321663dcb10.zip
r24643: add a ctdb_fetch() function to the ctdb client code
(This used to be commit 5705ee04498780d8ca89290e85b8ec831f0a185d)
-rw-r--r--source4/cluster/ctdb/client/ctdb_client.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source4/cluster/ctdb/client/ctdb_client.c b/source4/cluster/ctdb/client/ctdb_client.c
index d85f883b22..b569a69c8d 100644
--- a/source4/cluster/ctdb/client/ctdb_client.c
+++ b/source4/cluster/ctdb/client/ctdb_client.c
@@ -637,6 +637,30 @@ int ctdb_record_store(struct ctdb_record_handle *h, TDB_DATA data)
return ctdb_ltdb_store(h->ctdb_db, h->key, &h->header, data);
}
+/*
+ non-locking fetch of a record
+ */
+int ctdb_fetch(struct ctdb_db_context *ctdb_db, TALLOC_CTX *mem_ctx,
+ TDB_DATA key, TDB_DATA *data)
+{
+ struct ctdb_call call;
+ int ret;
+
+ call.call_id = CTDB_FETCH_FUNC;
+ call.call_data.dptr = NULL;
+ call.call_data.dsize = 0;
+
+ ret = ctdb_call(ctdb_db, &call);
+
+ if (ret == 0) {
+ *data = call.reply_data;
+ talloc_steal(mem_ctx, data->dptr);
+ }
+
+ return ret;
+}
+
+
struct ctdb_client_control_state {
struct ctdb_context *ctdb;
uint32_t reqid;