summaryrefslogtreecommitdiff
path: root/source4/cluster/ctdb/common/ctdb_ltdb.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-01-22 09:35:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:43:58 -0500
commitae7eab4cfc43b738bad15aec01233d41c2abbb83 (patch)
tree1b9bcdd7d2f40c206ed0317f4ffc2a693d1d9b70 /source4/cluster/ctdb/common/ctdb_ltdb.c
parente04e99585cabd225c79cb492d02509514f030486 (diff)
downloadsamba-ae7eab4cfc43b738bad15aec01233d41c2abbb83.tar.gz
samba-ae7eab4cfc43b738bad15aec01233d41c2abbb83.tar.bz2
samba-ae7eab4cfc43b738bad15aec01233d41c2abbb83.zip
r20945: fixed the bug causing locktest to fail with the ctdb backend after a
couple of hundred opertations. Also removed a lot of the debug code I was using to track this down. (This used to be commit 7622e7b4b2694ec14062d0f6de035b946106a6aa)
Diffstat (limited to 'source4/cluster/ctdb/common/ctdb_ltdb.c')
-rw-r--r--source4/cluster/ctdb/common/ctdb_ltdb.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/cluster/ctdb/common/ctdb_ltdb.c b/source4/cluster/ctdb/common/ctdb_ltdb.c
index cc49aa5016..fbf6a3e567 100644
--- a/source4/cluster/ctdb/common/ctdb_ltdb.c
+++ b/source4/cluster/ctdb/common/ctdb_ltdb.c
@@ -24,6 +24,8 @@
#include "system/network.h"
#include "system/filesys.h"
#include "cluster/ctdb/include/ctdb_private.h"
+#include "db_wrap.h"
+
/*
attach to a specific database
@@ -34,7 +36,7 @@ int ctdb_attach(struct ctdb_context *ctdb, const char *name, int tdb_flags,
/* when we have a separate daemon this will need to be a real
file, not a TDB_INTERNAL, so the parent can access it to
for ltdb bypass */
- ctdb->ltdb = tdb_open(name, 0, /* tdb_flags */ TDB_INTERNAL, open_flags, mode);
+ ctdb->ltdb = tdb_wrap_open(ctdb, name, 0, TDB_INTERNAL, open_flags, mode);
if (ctdb->ltdb == NULL) {
ctdb_set_error(ctdb, "Failed to open tdb %s\n", name);
return -1;
@@ -76,7 +78,7 @@ int ctdb_ltdb_fetch(struct ctdb_context *ctdb,
{
TDB_DATA rec;
- rec = tdb_fetch(ctdb->ltdb, key);
+ rec = tdb_fetch(ctdb->ltdb->tdb, key);
if (rec.dsize < sizeof(*header)) {
/* return an initial header */
free(rec.dptr);
@@ -116,7 +118,7 @@ int ctdb_ltdb_store(struct ctdb_context *ctdb, TDB_DATA key,
memcpy(rec.dptr, header, sizeof(*header));
memcpy(rec.dptr + sizeof(*header), data.dptr, data.dsize);
- ret = tdb_store(ctdb->ltdb, key, rec, TDB_REPLACE);
+ ret = tdb_store(ctdb->ltdb->tdb, key, rec, TDB_REPLACE);
talloc_free(rec.dptr);
return ret;