diff options
Diffstat (limited to 'src/datastore/gnunet-service-datastore.c')
-rw-r--r-- | src/datastore/gnunet-service-datastore.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index 6c064743e..09df51d9b 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c | |||
@@ -179,10 +179,6 @@ static GNUNET_SCHEDULER_TaskIdentifier expired_kill_task; | |||
179 | */ | 179 | */ |
180 | const struct GNUNET_CONFIGURATION_Handle *cfg; | 180 | const struct GNUNET_CONFIGURATION_Handle *cfg; |
181 | 181 | ||
182 | /** | ||
183 | * Our scheduler. | ||
184 | */ | ||
185 | struct GNUNET_SCHEDULER_Handle *sched; | ||
186 | 182 | ||
187 | /** | 183 | /** |
188 | * Handle for reporting statistics. | 184 | * Handle for reporting statistics. |
@@ -343,8 +339,7 @@ expired_processor (void *cls, | |||
343 | if (key == NULL) | 339 | if (key == NULL) |
344 | { | 340 | { |
345 | expired_kill_task | 341 | expired_kill_task |
346 | = GNUNET_SCHEDULER_add_delayed (sched, | 342 | = GNUNET_SCHEDULER_add_delayed (MAX_EXPIRE_DELAY, |
347 | MAX_EXPIRE_DELAY, | ||
348 | &delete_expired, | 343 | &delete_expired, |
349 | NULL); | 344 | NULL); |
350 | return GNUNET_SYSERR; | 345 | return GNUNET_SYSERR; |
@@ -1527,7 +1522,6 @@ load_plugin () | |||
1527 | } | 1522 | } |
1528 | ret = GNUNET_malloc (sizeof(struct DatastorePlugin)); | 1523 | ret = GNUNET_malloc (sizeof(struct DatastorePlugin)); |
1529 | ret->env.cfg = cfg; | 1524 | ret->env.cfg = cfg; |
1530 | ret->env.sched = sched; | ||
1531 | ret->env.duc = &disk_utilization_change_cb; | 1525 | ret->env.duc = &disk_utilization_change_cb; |
1532 | ret->env.cls = NULL; | 1526 | ret->env.cls = NULL; |
1533 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1527 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
@@ -1625,12 +1619,10 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1625 | } | 1619 | } |
1626 | if (expired_kill_task != GNUNET_SCHEDULER_NO_TASK) | 1620 | if (expired_kill_task != GNUNET_SCHEDULER_NO_TASK) |
1627 | { | 1621 | { |
1628 | GNUNET_SCHEDULER_cancel (sched, | 1622 | GNUNET_SCHEDULER_cancel (expired_kill_task); |
1629 | expired_kill_task); | ||
1630 | expired_kill_task = GNUNET_SCHEDULER_NO_TASK; | 1623 | expired_kill_task = GNUNET_SCHEDULER_NO_TASK; |
1631 | } | 1624 | } |
1632 | GNUNET_SCHEDULER_add_continuation (sched, | 1625 | GNUNET_SCHEDULER_add_continuation (&unload_task, |
1633 | &unload_task, | ||
1634 | NULL, | 1626 | NULL, |
1635 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 1627 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
1636 | } | 1628 | } |
@@ -1686,13 +1678,11 @@ cleanup_reservations (void *cls, | |||
1686 | * Process datastore requests. | 1678 | * Process datastore requests. |
1687 | * | 1679 | * |
1688 | * @param cls closure | 1680 | * @param cls closure |
1689 | * @param s scheduler to use | ||
1690 | * @param server the initialized server | 1681 | * @param server the initialized server |
1691 | * @param c configuration to use | 1682 | * @param c configuration to use |
1692 | */ | 1683 | */ |
1693 | static void | 1684 | static void |
1694 | run (void *cls, | 1685 | run (void *cls, |
1695 | struct GNUNET_SCHEDULER_Handle *s, | ||
1696 | struct GNUNET_SERVER_Handle *server, | 1686 | struct GNUNET_SERVER_Handle *server, |
1697 | const struct GNUNET_CONFIGURATION_Handle *c) | 1687 | const struct GNUNET_CONFIGURATION_Handle *c) |
1698 | { | 1688 | { |
@@ -1717,7 +1707,6 @@ run (void *cls, | |||
1717 | char *fn; | 1707 | char *fn; |
1718 | unsigned int bf_size; | 1708 | unsigned int bf_size; |
1719 | 1709 | ||
1720 | sched = s; | ||
1721 | cfg = c; | 1710 | cfg = c; |
1722 | if (GNUNET_OK != | 1711 | if (GNUNET_OK != |
1723 | GNUNET_CONFIGURATION_get_value_number (cfg, | 1712 | GNUNET_CONFIGURATION_get_value_number (cfg, |
@@ -1729,7 +1718,7 @@ run (void *cls, | |||
1729 | "DATASTORE"); | 1718 | "DATASTORE"); |
1730 | return; | 1719 | return; |
1731 | } | 1720 | } |
1732 | stats = GNUNET_STATISTICS_create (sched, "datastore", cfg); | 1721 | stats = GNUNET_STATISTICS_create ("datastore", cfg); |
1733 | GNUNET_STATISTICS_set (stats, | 1722 | GNUNET_STATISTICS_set (stats, |
1734 | gettext_noop ("# quota"), | 1723 | gettext_noop ("# quota"), |
1735 | quota, | 1724 | quota, |
@@ -1790,11 +1779,9 @@ run (void *cls, | |||
1790 | GNUNET_SERVER_disconnect_notify (server, &cleanup_reservations, NULL); | 1779 | GNUNET_SERVER_disconnect_notify (server, &cleanup_reservations, NULL); |
1791 | GNUNET_SERVER_add_handlers (server, handlers); | 1780 | GNUNET_SERVER_add_handlers (server, handlers); |
1792 | expired_kill_task | 1781 | expired_kill_task |
1793 | = GNUNET_SCHEDULER_add_with_priority (sched, | 1782 | = GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, |
1794 | GNUNET_SCHEDULER_PRIORITY_IDLE, | ||
1795 | &delete_expired, NULL); | 1783 | &delete_expired, NULL); |
1796 | GNUNET_SCHEDULER_add_delayed (sched, | 1784 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
1797 | GNUNET_TIME_UNIT_FOREVER_REL, | ||
1798 | &cleaning_task, NULL); | 1785 | &cleaning_task, NULL); |
1799 | } | 1786 | } |
1800 | 1787 | ||