From 974aa73160d50b7cf63b4a5e6dd7a7b1408ece42 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sat, 15 Feb 2014 13:01:33 +0100 Subject: [PATCH] ctdb-vacuum: simplify delete_marshall_traverse_first: use tdb_null we know anyways the record to store is empty at this point. So skip pointer calculations. Signed-off-by: Michael Adam Reviewed-by: Amitay Isaacs --- ctdb/server/ctdb_vacuum.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ctdb/server/ctdb_vacuum.c b/ctdb/server/ctdb_vacuum.c index 24d8cf9ecef..9e193a8a0a3 100644 --- a/ctdb/server/ctdb_vacuum.c +++ b/ctdb/server/ctdb_vacuum.c @@ -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", -- 2.11.4.GIT