aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/perf_datastore_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datastore/perf_datastore_api.c')
-rw-r--r--src/datastore/perf_datastore_api.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c
index 8dd7e6680..1f7c828e0 100644
--- a/src/datastore/perf_datastore_api.c
+++ b/src/datastore/perf_datastore_api.c
@@ -93,7 +93,6 @@ enum RunPhase
93 93
94struct CpsRunContext 94struct CpsRunContext
95{ 95{
96 struct GNUNET_SCHEDULER_Handle *sched;
97 const struct GNUNET_CONFIGURATION_Handle *cfg; 96 const struct GNUNET_CONFIGURATION_Handle *cfg;
98 enum RunPhase phase; 97 enum RunPhase phase;
99 int j; 98 int j;
@@ -140,8 +139,7 @@ check_success (void *cls,
140 else 139 else
141 crc->phase = RP_CUT; 140 crc->phase = RP_CUT;
142 } 141 }
143 GNUNET_SCHEDULER_add_continuation (crc->sched, 142 GNUNET_SCHEDULER_add_continuation (&run_continuation,
144 &run_continuation,
145 crc, 143 crc,
146 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 144 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
147} 145}
@@ -166,8 +164,7 @@ remove_next(void *cls,
166 fprintf (stderr, "D"); 164 fprintf (stderr, "D");
167#endif 165#endif
168 GNUNET_assert (GNUNET_OK == success); 166 GNUNET_assert (GNUNET_OK == success);
169 GNUNET_SCHEDULER_add_continuation (crc->sched, 167 GNUNET_SCHEDULER_add_continuation (&run_continuation,
170 &run_continuation,
171 crc, 168 crc,
172 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 169 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
173} 170}
@@ -212,14 +209,12 @@ delete_value (void *cls,
212 if (stored_bytes < MAX_SIZE) 209 if (stored_bytes < MAX_SIZE)
213 { 210 {
214 crc->phase = RP_REPORT; 211 crc->phase = RP_REPORT;
215 GNUNET_SCHEDULER_add_continuation (crc->sched, 212 GNUNET_SCHEDULER_add_continuation (&run_continuation,
216 &run_continuation,
217 crc, 213 crc,
218 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 214 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
219 return; 215 return;
220 } 216 }
221 GNUNET_SCHEDULER_add_with_priority (crc->sched, 217 GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_HIGH,
222 GNUNET_SCHEDULER_PRIORITY_HIGH,
223 &do_delete, 218 &do_delete,
224 crc); 219 crc);
225 return; 220 return;
@@ -298,8 +293,7 @@ run_continuation (void *cls,
298 1000 * stored_ops / (1 + GNUNET_TIME_absolute_get_duration(start_time).rel_value)); 293 1000 * stored_ops / (1 + GNUNET_TIME_absolute_get_duration(start_time).rel_value));
299 crc->phase = RP_PUT; 294 crc->phase = RP_PUT;
300 crc->j = 0; 295 crc->j = 0;
301 GNUNET_SCHEDULER_add_continuation (crc->sched, 296 GNUNET_SCHEDULER_add_continuation (&run_continuation,
302 &run_continuation,
303 crc, 297 crc,
304 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 298 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
305 break; 299 break;
@@ -330,8 +324,7 @@ run_tests (void *cls,
330 GNUNET_free (crc); 324 GNUNET_free (crc);
331 return; 325 return;
332 } 326 }
333 GNUNET_SCHEDULER_add_continuation (crc->sched, 327 GNUNET_SCHEDULER_add_continuation (&run_continuation,
334 &run_continuation,
335 crc, 328 crc,
336 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 329 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
337} 330}
@@ -339,7 +332,6 @@ run_tests (void *cls,
339 332
340static void 333static void
341run (void *cls, 334run (void *cls,
342 struct GNUNET_SCHEDULER_Handle *sched,
343 char *const *args, 335 char *const *args,
344 const char *cfgfile, 336 const char *cfgfile,
345 const struct GNUNET_CONFIGURATION_Handle *cfg) 337 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -347,10 +339,9 @@ run (void *cls,
347 struct CpsRunContext *crc; 339 struct CpsRunContext *crc;
348 static GNUNET_HashCode zkey; 340 static GNUNET_HashCode zkey;
349 341
350 datastore = GNUNET_DATASTORE_connect (cfg, sched); 342 datastore = GNUNET_DATASTORE_connect (cfg);
351 start_time = GNUNET_TIME_absolute_get (); 343 start_time = GNUNET_TIME_absolute_get ();
352 crc = GNUNET_malloc(sizeof(struct CpsRunContext)); 344 crc = GNUNET_malloc(sizeof(struct CpsRunContext));
353 crc->sched = sched;
354 crc->cfg = cfg; 345 crc->cfg = cfg;
355 crc->phase = RP_PUT; 346 crc->phase = RP_PUT;
356 if (NULL == 347 if (NULL ==