From dd7ac4f38d5dc9119091b49b41471ea6723f6e0d Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 5 Aug 2008 18:46:02 +0200 Subject: dbwrap ctdb: call db_ctdb_store() in db_ctdb_delete(). to reduce code duplication. Michael (This used to be commit 09a197e756459877cab7b4d09f534c6a41cfdd71) --- source3/lib/dbwrap_ctdb.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'source3/lib/dbwrap_ctdb.c') 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) -- cgit