aboutsummaryrefslogtreecommitdiff
path: root/src/datacache
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-11-05 18:21:50 +0000
committerNathan S. Evans <evans@in.tum.de>2010-11-05 18:21:50 +0000
commit75a33a1499cf60ea4364c9aa673816629a6c1413 (patch)
tree0620da4312bb04de4d7b65074fdd3b0c3dd6cc0e /src/datacache
parent7217c601ad30760872823193d62307e7a335d226 (diff)
downloadgnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.tar.gz
gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.zip
big scheduler refactoring, expect some issues
Diffstat (limited to 'src/datacache')
-rw-r--r--src/datacache/datacache.c8
-rw-r--r--src/datacache/perf_datacache.c4
-rw-r--r--src/datacache/plugin_datacache.h4
-rw-r--r--src/datacache/test_datacache.c4
-rw-r--r--src/datacache/test_datacache_quota.c4
5 files changed, 5 insertions, 19 deletions
diff --git a/src/datacache/datacache.c b/src/datacache/datacache.c
index d2aa2616a..9bb0f14b9 100644
--- a/src/datacache/datacache.c
+++ b/src/datacache/datacache.c
@@ -116,14 +116,12 @@ env_delete_notify (void *cls,
116/** 116/**
117 * Create a data cache. 117 * Create a data cache.
118 * 118 *
119 * @param sched scheduler to use
120 * @param cfg configuration to use 119 * @param cfg configuration to use
121 * @param section section in the configuration that contains our options 120 * @param section section in the configuration that contains our options
122 * @return handle to use to access the service 121 * @return handle to use to access the service
123 */ 122 */
124struct GNUNET_DATACACHE_Handle * 123struct GNUNET_DATACACHE_Handle *
125GNUNET_DATACACHE_create (struct GNUNET_SCHEDULER_Handle *sched, 124GNUNET_DATACACHE_create (const struct GNUNET_CONFIGURATION_Handle *cfg,
126 const struct GNUNET_CONFIGURATION_Handle *cfg,
127 const char *section) 125 const char *section)
128{ 126{
129 unsigned int bf_size; 127 unsigned int bf_size;
@@ -167,11 +165,9 @@ GNUNET_DATACACHE_create (struct GNUNET_SCHEDULER_Handle *sched,
167 { 165 {
168 ret->filter = GNUNET_CONTAINER_bloomfilter_load (NULL, bf_size, 5); /* approx. 3% false positives at max use */ 166 ret->filter = GNUNET_CONTAINER_bloomfilter_load (NULL, bf_size, 5); /* approx. 3% false positives at max use */
169 } 167 }
170 ret->stats = GNUNET_STATISTICS_create (sched, 168 ret->stats = GNUNET_STATISTICS_create ("datacache",
171 "datacache",
172 cfg); 169 cfg);
173 ret->section = GNUNET_strdup (section); 170 ret->section = GNUNET_strdup (section);
174 ret->env.sched = sched;
175 ret->env.cfg = cfg; 171 ret->env.cfg = cfg;
176 ret->env.delete_notify = &env_delete_notify; 172 ret->env.delete_notify = &env_delete_notify;
177 ret->env.section = ret->section; 173 ret->env.section = ret->section;
diff --git a/src/datacache/perf_datacache.c b/src/datacache/perf_datacache.c
index 904238f85..f32574019 100644
--- a/src/datacache/perf_datacache.c
+++ b/src/datacache/perf_datacache.c
@@ -59,7 +59,6 @@ checkIt (void *cls,
59 59
60static void 60static void
61run (void *cls, 61run (void *cls,
62 struct GNUNET_SCHEDULER_Handle *sched,
63 char *const *args, 62 char *const *args,
64 const char *cfgfile, 63 const char *cfgfile,
65 const struct GNUNET_CONFIGURATION_Handle *cfg) 64 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -72,8 +71,7 @@ run (void *cls,
72 unsigned int i; 71 unsigned int i;
73 72
74 ok = 0; 73 ok = 0;
75 h = GNUNET_DATACACHE_create (sched, 74 h = GNUNET_DATACACHE_create (cfg,
76 cfg,
77 "perfcache"); 75 "perfcache");
78 76
79 if (h == NULL) 77 if (h == NULL)
diff --git a/src/datacache/plugin_datacache.h b/src/datacache/plugin_datacache.h
index bf35b2619..850d3961e 100644
--- a/src/datacache/plugin_datacache.h
+++ b/src/datacache/plugin_datacache.h
@@ -58,10 +58,6 @@ typedef void (*GNUNET_DATACACHE_DeleteNotifyCallback)(void *cls,
58struct GNUNET_DATACACHE_PluginEnvironment 58struct GNUNET_DATACACHE_PluginEnvironment
59{ 59{
60 60
61 /**
62 * Scheduler to use.
63 */
64 struct GNUNET_SCHEDULER_Handle *sched;
65 61
66 /** 62 /**
67 * Configuration to use. 63 * Configuration to use.
diff --git a/src/datacache/test_datacache.c b/src/datacache/test_datacache.c
index d0785173e..b626ce67d 100644
--- a/src/datacache/test_datacache.c
+++ b/src/datacache/test_datacache.c
@@ -62,7 +62,6 @@ checkIt (void *cls,
62 62
63static void 63static void
64run (void *cls, 64run (void *cls,
65 struct GNUNET_SCHEDULER_Handle *sched,
66 char *const *args, 65 char *const *args,
67 const char *cfgfile, 66 const char *cfgfile,
68 const struct GNUNET_CONFIGURATION_Handle *cfg) 67 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -74,8 +73,7 @@ run (void *cls,
74 unsigned int i; 73 unsigned int i;
75 74
76 ok = 0; 75 ok = 0;
77 h = GNUNET_DATACACHE_create (sched, 76 h = GNUNET_DATACACHE_create (cfg,
78 cfg,
79 "testcache"); 77 "testcache");
80 if (h == NULL) 78 if (h == NULL)
81 { 79 {
diff --git a/src/datacache/test_datacache_quota.c b/src/datacache/test_datacache_quota.c
index 4674a7da9..77ad63815 100644
--- a/src/datacache/test_datacache_quota.c
+++ b/src/datacache/test_datacache_quota.c
@@ -45,7 +45,6 @@ static const char *plugin_name;
45 */ 45 */
46static void 46static void
47run (void *cls, 47run (void *cls,
48 struct GNUNET_SCHEDULER_Handle *sched,
49 char *const *args, 48 char *const *args,
50 const char *cfgfile, 49 const char *cfgfile,
51 const struct GNUNET_CONFIGURATION_Handle *cfg) 50 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -59,8 +58,7 @@ run (void *cls,
59 struct GNUNET_TIME_Absolute exp; 58 struct GNUNET_TIME_Absolute exp;
60 59
61 ok = 0; 60 ok = 0;
62 h = GNUNET_DATACACHE_create (sched, 61 h = GNUNET_DATACACHE_create (cfg,
63 cfg,
64 "testcache"); 62 "testcache");
65 63
66 if (h == NULL) 64 if (h == NULL)