summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-08-05 18:47:40 +0200
committerMichael Adam <obnox@samba.org>2008-08-13 11:54:07 +0200
commit873e74705fee37aba4c134fc48cfa3bae5df4afb (patch)
tree9f816d04cd8fe33a6cd7b8ad249b4ef0f3fcc375
parentdd7ac4f38d5dc9119091b49b41471ea6723f6e0d (diff)
downloadsamba-873e74705fee37aba4c134fc48cfa3bae5df4afb.tar.gz
samba-873e74705fee37aba4c134fc48cfa3bae5df4afb.tar.bz2
samba-873e74705fee37aba4c134fc48cfa3bae5df4afb.zip
dbwrap ctdb: add db_ctdb_delete_persistent() and use it for persistent DBs
as delete_rec operation from fetch_locked() Michael (This used to be commit f4aab595a0219305fbedf8890e787b690660a55a)
-rw-r--r--source3/lib/dbwrap_ctdb.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index 0c5e624411..1cccecbad9 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -199,6 +199,21 @@ static NTSTATUS db_ctdb_delete(struct db_record *rec)
}
+static NTSTATUS db_ctdb_delete_persistent(struct db_record *rec)
+{
+ TDB_DATA data;
+
+ /*
+ * We have to store the header with empty data. TODO: Fix the
+ * tdb-level cleanup
+ */
+
+ ZERO_STRUCT(data);
+
+ return db_ctdb_store_persistent(rec, data, 0);
+
+}
+
static int db_ctdb_record_destr(struct db_record* data)
{
struct db_ctdb_rec *crec = talloc_get_type_abort(
@@ -274,10 +289,11 @@ again:
if (persistent) {
result->store = db_ctdb_store_persistent;
+ result->delete_rec = db_ctdb_delete_persistent;
} else {
result->store = db_ctdb_store;
+ result->delete_rec = db_ctdb_delete;
}
- result->delete_rec = db_ctdb_delete;
talloc_set_destructor(result, db_ctdb_record_destr);
ctdb_data = tdb_fetch(ctx->wtdb->tdb, key);