dbwrap ctdb: call db_ctdb_store() in db_ctdb_delete().
authorMichael Adam <obnox@samba.org>
Tue, 5 Aug 2008 16:46:02 +0000 (18:46 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 13 Aug 2008 09:54:07 +0000 (11:54 +0200)
to reduce code duplication.

Michael
(This used to be commit 09a197e756459877cab7b4d09f534c6a41cfdd71)

source3/lib/dbwrap_ctdb.c

index bdcec3985d0649c4ad27c114047305d91061677d..0c5e624411902aa17fb4a7ed37171c23e4b49d59 100644 (file)
@@ -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)