fix #4546
[oweals/gnunet.git] / src / datastore / perf_plugin_datastore.c
index d31d5facf42e43f6069d33b375af2369bc10d73e..cbc01844e5aa1ad63be96f4ae29218138186feb2 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2004, 2005, 2006, 2007, 2009, 2011 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2004, 2005, 2006, 2007, 2009, 2011 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -99,12 +99,24 @@ disk_utilization_change_cb (void *cls, int delta)
 
 
 static void
-test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+test (void *cls);
 
 
+/**
+ * Put continuation.
+ *
+ * @param cls closure
+ * @param key key for the item stored
+ * @param size size of the item stored
+ * @param status #GNUNET_OK or #GNUNET_SYSERROR
+ * @param msg error message on error
+ */
 static void
-put_continuation (void *cls, const struct GNUNET_HashCode *key,
-                  uint32_t size, int status, char *msg)
+put_continuation (void *cls,
+                 const struct GNUNET_HashCode *key,
+                  uint32_t size,
+                 int status,
+                 const char *msg)
 {
   struct CpsRunContext *crc = cls;
 
@@ -121,6 +133,7 @@ put_continuation (void *cls, const struct GNUNET_HashCode *key,
   GNUNET_SCHEDULER_add_now (&test, crc);
 }
 
+
 static void
 do_put (struct CpsRunContext *crc)
 {
@@ -183,9 +196,14 @@ do_put (struct CpsRunContext *crc)
 
 
 static int
-iterate_zeros (void *cls, const struct GNUNET_HashCode * key, uint32_t size,
-               const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority,
-               uint32_t anonymity, struct GNUNET_TIME_Absolute expiration,
+iterate_zeros (void *cls,
+              const struct GNUNET_HashCode *key,
+              uint32_t size,
+               const void *data,
+              enum GNUNET_BLOCK_Type type,
+              uint32_t priority,
+               uint32_t anonymity,
+              struct GNUNET_TIME_Absolute expiration,
                uint64_t uid)
 {
   struct CpsRunContext *crc = cls;
@@ -234,10 +252,15 @@ iterate_zeros (void *cls, const struct GNUNET_HashCode * key, uint32_t size,
 
 
 static int
-expiration_get (void *cls, const struct GNUNET_HashCode * key, uint32_t size,
-                const void *data, enum GNUNET_BLOCK_Type type,
-                uint32_t priority, uint32_t anonymity,
-                struct GNUNET_TIME_Absolute expiration, uint64_t uid)
+expiration_get (void *cls,
+               const struct GNUNET_HashCode *key,
+               uint32_t size,
+                const void *data,
+               enum GNUNET_BLOCK_Type type,
+                uint32_t priority,
+               uint32_t anonymity,
+                struct GNUNET_TIME_Absolute expiration,
+               uint64_t uid)
 {
   struct CpsRunContext *crc = cls;
   int i;
@@ -281,10 +304,15 @@ expiration_get (void *cls, const struct GNUNET_HashCode * key, uint32_t size,
 
 
 static int
-replication_get (void *cls, const struct GNUNET_HashCode * key, uint32_t size,
-                 const void *data, enum GNUNET_BLOCK_Type type,
-                 uint32_t priority, uint32_t anonymity,
-                 struct GNUNET_TIME_Absolute expiration, uint64_t uid)
+replication_get (void *cls,
+                const struct GNUNET_HashCode *key,
+                uint32_t size,
+                 const void *data,
+                enum GNUNET_BLOCK_Type type,
+                 uint32_t priority,
+                uint32_t anonymity,
+                 struct GNUNET_TIME_Absolute expiration,
+                uint64_t uid)
 {
   struct CpsRunContext *crc = cls;
   int i;
@@ -363,7 +391,7 @@ unload_plugin (struct GNUNET_DATASTORE_PluginFunctions *api,
  * the transport and core.
  */
 static void
-cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+cleaning_task (void *cls)
 {
   struct CpsRunContext *crc = cls;
 
@@ -373,15 +401,10 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 
 static void
-test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+test (void *cls)
 {
   struct CpsRunContext *crc = cls;
 
-  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-  {
-    GNUNET_break (0);
-    crc->phase = RP_ERROR;
-  }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "In phase %d, iteration %u\n", crc->phase, crc->cnt);
   switch (crc->phase)