summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_vacuum.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-02-16 01:08:18 +0100
committerAmitay Isaacs <amitay@gmail.com>2014-03-06 11:31:15 +1100
commit49eb503c5d3133e1476a15f9d11ce4269407e6c6 (patch)
tree25e542ac2be0e6fb229848923cff8de6e377ee06 /ctdb/server/ctdb_vacuum.c
parent776d4e88f2a6068016dedd37003cdde10f8090a5 (diff)
downloadsamba-49eb503c5d3133e1476a15f9d11ce4269407e6c6.tar.gz
samba-49eb503c5d3133e1476a15f9d11ce4269407e6c6.tar.xz
samba-49eb503c5d3133e1476a15f9d11ce4269407e6c6.zip
ctdb-vacuum: make ctdb_process_delete_list() void
The overall return code was not really used anyways. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/server/ctdb_vacuum.c')
-rw-r--r--ctdb/server/ctdb_vacuum.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/ctdb/server/ctdb_vacuum.c b/ctdb/server/ctdb_vacuum.c
index 60e3957f3a7..689b8535f09 100644
--- a/ctdb/server/ctdb_vacuum.c
+++ b/ctdb/server/ctdb_vacuum.c
@@ -821,8 +821,8 @@ static void ctdb_process_vacuum_fetch_lists(struct ctdb_db_context *ctdb_db,
* 3) The lmaster locally deletes its copies of all records that
* could successfully be deleted remotely in step #2.
*/
-static int ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
- struct vacuum_data *vdata)
+static void ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
+ struct vacuum_data *vdata)
{
int ret, i;
struct ctdb_context *ctdb = ctdb_db->ctdb;
@@ -835,13 +835,13 @@ static int ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
uint32_t sum;
if (vdata->delete_count == 0) {
- return 0;
+ return;
}
tmp_ctx = talloc_new(vdata);
if (tmp_ctx == NULL) {
DEBUG(DEBUG_ERR,(__location__ " Out of memory\n"));
- return 0;
+ return;
}
vdata->delete_left = vdata->delete_count;
@@ -856,7 +856,6 @@ static int ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
&nodemap);
if (ret != 0) {
DEBUG(DEBUG_ERR,(__location__ " unable to get node map\n"));
- ret = -1;
goto done;
}
@@ -883,7 +882,6 @@ static int ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
recs = talloc_zero(tmp_ctx, struct delete_records_list);
if (recs == NULL) {
DEBUG(DEBUG_ERR,(__location__ " Out of memory\n"));
- ret = -1;
goto done;
}
recs->records = (struct ctdb_marshall_buffer *)
@@ -891,7 +889,6 @@ static int ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
offsetof(struct ctdb_marshall_buffer, data));
if (recs->records == NULL) {
DEBUG(DEBUG_ERR,(__location__ " Out of memory\n"));
- ret = -1;
goto done;
}
recs->records->db_id = ctdb_db->db_id;
@@ -929,7 +926,6 @@ static int ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
DEBUG(DEBUG_ERR, ("Error storing record copies on "
"node %u: ret[%d] res[%d]\n",
active_nodes[i], ret, res));
- ret = -1;
goto done;
}
@@ -953,7 +949,6 @@ static int ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
if (recdata.dsize < sizeof(struct ctdb_ltdb_header)) {
DEBUG(DEBUG_CRIT,(__location__ " bad ltdb record\n"));
- ret = -1;
goto done;
}
rechdr = (struct ctdb_ltdb_header *)recdata.dptr;
@@ -1002,7 +997,6 @@ static int ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
offsetof(struct ctdb_marshall_buffer, data));
if (recs->records == NULL) {
DEBUG(DEBUG_ERR,(__location__ " Out of memory\n"));
- ret = -1;
goto done;
}
recs->records->db_id = ctdb_db->db_id;
@@ -1031,7 +1025,6 @@ static int ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
DEBUG(DEBUG_ERR, ("Failed to delete records on "
"node %u: ret[%d] res[%d]\n",
active_nodes[i], ret, res));
- ret = -1;
goto done;
}
@@ -1055,7 +1048,6 @@ static int ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
if (recdata.dsize < sizeof(struct ctdb_ltdb_header)) {
DEBUG(DEBUG_CRIT,(__location__ " bad ltdb record\n"));
- ret = -1;
goto done;
}
rechdr = (struct ctdb_ltdb_header *)recdata.dptr;
@@ -1143,12 +1135,10 @@ success:
(unsigned)vdata->delete_left));
}
- ret = 0;
-
done:
talloc_free(tmp_ctx);
- return ret;
+ return;
}
/**
@@ -1270,10 +1260,7 @@ static int ctdb_vacuum_db(struct ctdb_db_context *ctdb_db,
ctdb_process_vacuum_fetch_lists(ctdb_db, vdata);
- ret = ctdb_process_delete_list(ctdb_db, vdata);
- if (ret != 0) {
- return ret;
- }
+ ctdb_process_delete_list(ctdb_db, vdata);
/* this ensures we run our event queue */
ctdb_ctrl_getpnn(ctdb, TIMELIMIT(), CTDB_CURRENT_NODE);