With the processing of one element factored out,
it is more natural to have the actual loop inside the
handler function. This also makes the talloc/free
bracked around the loop more obvious.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
-/*
- process the next element from the vacuum list
-*/
-static void vacuum_fetch_next(struct vacuum_info *v)
-{
- while (v->recs->count) {
- struct ctdb_rec_data *r;
- bool ok;
-
- r = v->r;
-
- ok = vacuum_fetch_process_one(v->ctdb_db, v->rec->ctdb->pnn, r);
- if (!ok) {
- break;
- }
-
- v->r = (struct ctdb_rec_data *)(r->length + (uint8_t *)r);
- v->recs->count--;
- }
-
- talloc_free(v);
-}
-
/*
destroy a vacuum info structure
/*
destroy a vacuum info structure
talloc_set_destructor(v, vacuum_info_destructor);
talloc_set_destructor(v, vacuum_info_destructor);
+ while (v->recs->count) {
+ bool ok;
+
+ r = v->r;
+
+ ok = vacuum_fetch_process_one(v->ctdb_db, v->rec->ctdb->pnn, r);
+ if (!ok) {
+ break;
+ }
+
+ v->r = (struct ctdb_rec_data *)(r->length + (uint8_t *)r);
+ v->recs->count--;
+ }
+
+ talloc_free(v);
done:
talloc_free(tmp_ctx);
done:
talloc_free(tmp_ctx);