summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-08-05 18:46:02 +0200
committerMichael Adam <obnox@samba.org>2008-08-13 11:54:07 +0200
commitdd7ac4f38d5dc9119091b49b41471ea6723f6e0d (patch)
tree4d53d5a0435e2b07aa43372d5ac839e8c456b949
parent5dcf20961ee52eca4eb0bb4ab0e20ebd547c8058 (diff)
downloadsamba-dd7ac4f38d5dc9119091b49b41471ea6723f6e0d.tar.gz
samba-dd7ac4f38d5dc9119091b49b41471ea6723f6e0d.tar.bz2
samba-dd7ac4f38d5dc9119091b49b41471ea6723f6e0d.zip
dbwrap ctdb: call db_ctdb_store() in db_ctdb_delete().
to reduce code duplication. Michael (This used to be commit 09a197e756459877cab7b4d09f534c6a41cfdd71)
-rw-r--r--source3/lib/dbwrap_ctdb.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index bdcec3985d..0c5e624411 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -186,22 +186,17 @@ static NTSTATUS db_ctdb_store_persistent(struct db_record *rec, TDB_DATA data, i
static NTSTATUS db_ctdb_delete(struct db_record *rec)
{
- struct db_ctdb_rec *crec = talloc_get_type_abort(
- rec->private_data, struct db_ctdb_rec);
TDB_DATA data;
- int ret;
/*
* We have to store the header with empty data. TODO: Fix the
* tdb-level cleanup
*/
- data.dptr = (uint8 *)&crec->header;
- data.dsize = sizeof(crec->header);
+ ZERO_STRUCT(data);
- ret = tdb_store(crec->ctdb_ctx->wtdb->tdb, rec->key, data, TDB_REPLACE);
+ return db_ctdb_store(rec, data, 0);
- return (ret == 0) ? NT_STATUS_OK : NT_STATUS_INTERNAL_DB_CORRUPTION;
}
static int db_ctdb_record_destr(struct db_record* data)