ctdb-vacuum: simplify delete_marshall_traverse_first: use tdb_null
authorMichael Adam <obnox@samba.org>
Sat, 15 Feb 2014 12:01:33 +0000 (13:01 +0100)
committerAmitay Isaacs <amitay@gmail.com>
Thu, 6 Mar 2014 00:31:14 +0000 (11:31 +1100)
we know anyways the record to store is empty at this point.
So skip pointer calculations.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_vacuum.c

index 24d8cf9ecef421098ebf7c3d73ca3fa6610fe9dd..9e193a8a0a346c057df75845561245493c70ddec 100644 (file)
@@ -325,7 +325,7 @@ static int delete_marshall_traverse_first(void *param, void *data)
        struct ctdb_db_context *ctdb_db = dd->ctdb_db;
        struct ctdb_context *ctdb = ctdb_db->ctdb;
        struct ctdb_ltdb_header *header;
-       TDB_DATA tdb_data, ctdb_data;
+       TDB_DATA tdb_data;
        uint32_t lmaster;
        uint32_t hash = ctdb_hash(&(dd->key));
        int res;
@@ -409,10 +409,7 @@ static int delete_marshall_traverse_first(void *param, void *data)
         * on the record's dmaster.
         */
 
-       ctdb_data.dptr = tdb_data.dptr + sizeof(struct ctdb_ltdb_header);
-       ctdb_data.dsize = tdb_data.dsize - sizeof(struct ctdb_ltdb_header);
-
-       res = ctdb_ltdb_store(ctdb_db, dd->key, header, ctdb_data);
+       res = ctdb_ltdb_store(ctdb_db, dd->key, header, tdb_null);
        if (res != 0) {
                DEBUG(DEBUG_ERR, (__location__ ": Failed to store record with "
                                  "key hash [0x%08x] on database db[%s].\n",