ctdb-vacuum: Use existing function ctdb_marshall_finish
authorAmitay Isaacs <amitay@gmail.com>
Tue, 6 May 2014 08:52:54 +0000 (18:52 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 23 Jul 2014 07:44:00 +0000 (09:44 +0200)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Jul 23 09:44:00 CEST 2014 on sn-devel-104

ctdb/server/ctdb_recover.c
ctdb/server/ctdb_vacuum.c

index aa6abbeaaadb811afb6172483d8a0908f742335c..ecf3aba30192a6ba60c7f9441b6e8abd68d49cfd 100644 (file)
@@ -1092,8 +1092,7 @@ int32_t ctdb_control_try_delete_records(struct ctdb_context *ctdb, TDB_DATA inda
        }           
 
 
-       outdata->dptr = (uint8_t *)records;
-       outdata->dsize = talloc_get_size(records);
+       *outdata = ctdb_marshall_finish(records);
 
        return 0;
 }
@@ -1290,9 +1289,7 @@ int32_t ctdb_control_receive_records(struct ctdb_context *ctdb,
                rec = (struct ctdb_rec_data *)(rec->length + (uint8_t *)rec);
        }
 
-
-       outdata->dptr = (uint8_t *)records;
-       outdata->dsize = talloc_get_size(records);
+       *outdata = ctdb_marshall_finish(records);
 
        return 0;
 }
index fe59a83fcfac13dcb26bfe7ae9047f26d3683e70..be3ee1e8b4c618232ee6b822ef96c19187327294 100644 (file)
@@ -775,8 +775,7 @@ static void ctdb_process_vacuum_fetch_lists(struct ctdb_db_context *ctdb_db,
                                   vfl->count, ctdb->nodes[i]->pnn,
                                   ctdb_db->db_name));
 
-               data.dsize = talloc_get_size(vfl);
-               data.dptr  = (void *)vfl;
+               data = ctdb_marshall_finish(vfl);
                if (ctdb_client_send_message(ctdb, ctdb->nodes[i]->pnn,
                                             CTDB_SRVID_VACUUM_FETCH,
                                             data) != 0)
@@ -901,8 +900,7 @@ static void ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
                      "delete list for first marshalling.\n"));
        }
 
-       indata.dsize = talloc_get_size(recs->records);
-       indata.dptr  = (void *)recs->records;
+       indata = ctdb_marshall_finish(recs->records);
 
        for (i = 0; i < num_active_nodes; i++) {
                struct ctdb_marshall_buffer *records;
@@ -1009,8 +1007,7 @@ static void ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
                goto done;
        }
 
-       indata.dsize = talloc_get_size(recs->records);
-       indata.dptr  = (void *)recs->records;
+       indata = ctdb_marshall_finish(recs->records);
 
        for (i = 0; i < num_active_nodes; i++) {
                struct ctdb_marshall_buffer *records;