diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-04-03 20:00:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-04-03 20:00:42 +0000 |
commit | e8f35bb025c25839a52fb502e452393831e4e6f0 (patch) | |
tree | 7a056253bddc61b1e6a3258567e176af128c2b67 /src/fs | |
parent | 9f871785d57da57ba128ac2279fda1db1d9b8bfb (diff) | |
download | gnunet-e8f35bb025c25839a52fb502e452393831e4e6f0.tar.gz gnunet-e8f35bb025c25839a52fb502e452393831e4e6f0.zip |
improving datastore API --- not working yet
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs.c | 56 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 34 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_push.c | 6 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_put.c | 12 |
4 files changed, 54 insertions, 54 deletions
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index caf534140..35d89c50f 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -1297,7 +1297,7 @@ process_migration_content (void *cls, | |||
1297 | MIN_MIGRATION_CONTENT_LIFETIME.rel_value) | 1297 | MIN_MIGRATION_CONTENT_LIFETIME.rel_value) |
1298 | { | 1298 | { |
1299 | /* content will expire soon, don't bother */ | 1299 | /* content will expire soon, don't bother */ |
1300 | GNUNET_DATASTORE_get_next (dsh); | 1300 | GNUNET_DATASTORE_iterate_get_next (dsh); |
1301 | return; | 1301 | return; |
1302 | } | 1302 | } |
1303 | if (type == GNUNET_BLOCK_TYPE_FS_ONDEMAND) | 1303 | if (type == GNUNET_BLOCK_TYPE_FS_ONDEMAND) |
@@ -1309,7 +1309,7 @@ process_migration_content (void *cls, | |||
1309 | &process_migration_content, | 1309 | &process_migration_content, |
1310 | NULL)) | 1310 | NULL)) |
1311 | { | 1311 | { |
1312 | GNUNET_DATASTORE_get_next (dsh); | 1312 | GNUNET_DATASTORE_iterate_get_next (dsh); |
1313 | } | 1313 | } |
1314 | return; | 1314 | return; |
1315 | } | 1315 | } |
@@ -1333,7 +1333,7 @@ process_migration_content (void *cls, | |||
1333 | GNUNET_CONTAINER_multihashmap_iterate (connected_peers, | 1333 | GNUNET_CONTAINER_multihashmap_iterate (connected_peers, |
1334 | &consider_migration, | 1334 | &consider_migration, |
1335 | mb); | 1335 | mb); |
1336 | GNUNET_DATASTORE_get_next (dsh); | 1336 | GNUNET_DATASTORE_iterate_get_next (dsh); |
1337 | } | 1337 | } |
1338 | 1338 | ||
1339 | 1339 | ||
@@ -1344,7 +1344,7 @@ static void | |||
1344 | dht_put_continuation (void *cls, | 1344 | dht_put_continuation (void *cls, |
1345 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 1345 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
1346 | { | 1346 | { |
1347 | GNUNET_DATASTORE_get_next (dsh); | 1347 | GNUNET_DATASTORE_iterate_get_next (dsh); |
1348 | } | 1348 | } |
1349 | 1349 | ||
1350 | 1350 | ||
@@ -1455,10 +1455,10 @@ gather_dht_put_blocks (void *cls, | |||
1455 | { | 1455 | { |
1456 | if (dht_put_type == GNUNET_BLOCK_TYPE_FS_ONDEMAND) | 1456 | if (dht_put_type == GNUNET_BLOCK_TYPE_FS_ONDEMAND) |
1457 | dht_put_type = GNUNET_BLOCK_TYPE_FS_KBLOCK; | 1457 | dht_put_type = GNUNET_BLOCK_TYPE_FS_KBLOCK; |
1458 | dht_qe = GNUNET_DATASTORE_get_zero_anonymity (dsh, 0, UINT_MAX, | 1458 | dht_qe = GNUNET_DATASTORE_iterate_zero_anonymity (dsh, 0, UINT_MAX, |
1459 | GNUNET_TIME_UNIT_FOREVER_REL, | 1459 | GNUNET_TIME_UNIT_FOREVER_REL, |
1460 | dht_put_type++, | 1460 | dht_put_type++, |
1461 | &process_dht_put_content, NULL); | 1461 | &process_dht_put_content, NULL); |
1462 | GNUNET_assert (dht_qe != NULL); | 1462 | GNUNET_assert (dht_qe != NULL); |
1463 | } | 1463 | } |
1464 | } | 1464 | } |
@@ -3991,7 +3991,7 @@ process_local_reply (void *cls, | |||
3991 | pr)) | 3991 | pr)) |
3992 | if (pr->qe != NULL) | 3992 | if (pr->qe != NULL) |
3993 | { | 3993 | { |
3994 | GNUNET_DATASTORE_get_next (dsh); | 3994 | GNUNET_DATASTORE_iterate_get_next (dsh); |
3995 | } | 3995 | } |
3996 | return; | 3996 | return; |
3997 | } | 3997 | } |
@@ -4014,7 +4014,7 @@ process_local_reply (void *cls, | |||
4014 | -1, -1, | 4014 | -1, -1, |
4015 | GNUNET_TIME_UNIT_FOREVER_REL, | 4015 | GNUNET_TIME_UNIT_FOREVER_REL, |
4016 | NULL, NULL); | 4016 | NULL, NULL); |
4017 | GNUNET_DATASTORE_get_next (dsh); | 4017 | GNUNET_DATASTORE_iterate_get_next (dsh); |
4018 | return; | 4018 | return; |
4019 | } | 4019 | } |
4020 | prq.type = type; | 4020 | prq.type = type; |
@@ -4033,7 +4033,7 @@ process_local_reply (void *cls, | |||
4033 | if (prq.eval == GNUNET_BLOCK_EVALUATION_OK_LAST) | 4033 | if (prq.eval == GNUNET_BLOCK_EVALUATION_OK_LAST) |
4034 | { | 4034 | { |
4035 | pr->local_only = GNUNET_YES; /* do not forward */ | 4035 | pr->local_only = GNUNET_YES; /* do not forward */ |
4036 | GNUNET_DATASTORE_get_next (dsh); | 4036 | GNUNET_DATASTORE_iterate_get_next (dsh); |
4037 | return; | 4037 | return; |
4038 | } | 4038 | } |
4039 | if ( (pr->client_request_list == NULL) && | 4039 | if ( (pr->client_request_list == NULL) && |
@@ -4048,10 +4048,10 @@ process_local_reply (void *cls, | |||
4048 | gettext_noop ("# processing result set cut short due to load"), | 4048 | gettext_noop ("# processing result set cut short due to load"), |
4049 | 1, | 4049 | 1, |
4050 | GNUNET_NO); | 4050 | GNUNET_NO); |
4051 | GNUNET_DATASTORE_get_next (dsh); | 4051 | GNUNET_DATASTORE_iterate_get_next (dsh); |
4052 | return; | 4052 | return; |
4053 | } | 4053 | } |
4054 | GNUNET_DATASTORE_get_next (dsh); | 4054 | GNUNET_DATASTORE_iterate_get_next (dsh); |
4055 | } | 4055 | } |
4056 | 4056 | ||
4057 | 4057 | ||
@@ -4412,14 +4412,14 @@ handle_p2p_get (void *cls, | |||
4412 | "Handing request for `%s' to datastore\n", | 4412 | "Handing request for `%s' to datastore\n", |
4413 | GNUNET_h2s (&gm->query)); | 4413 | GNUNET_h2s (&gm->query)); |
4414 | #endif | 4414 | #endif |
4415 | pr->qe = GNUNET_DATASTORE_get (dsh, | 4415 | pr->qe = GNUNET_DATASTORE_iterate_key (dsh, |
4416 | &gm->query, | 4416 | &gm->query, |
4417 | type, | 4417 | type, |
4418 | pr->priority + 1, | 4418 | pr->priority + 1, |
4419 | MAX_DATASTORE_QUEUE, | 4419 | MAX_DATASTORE_QUEUE, |
4420 | timeout, | 4420 | timeout, |
4421 | &process_local_reply, | 4421 | &process_local_reply, |
4422 | pr); | 4422 | pr); |
4423 | if (NULL == pr->qe) | 4423 | if (NULL == pr->qe) |
4424 | { | 4424 | { |
4425 | GNUNET_STATISTICS_update (stats, | 4425 | GNUNET_STATISTICS_update (stats, |
@@ -4617,13 +4617,13 @@ handle_start_search (void *cls, | |||
4617 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE)); | 4617 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE)); |
4618 | if (type == GNUNET_BLOCK_TYPE_FS_DBLOCK) | 4618 | if (type == GNUNET_BLOCK_TYPE_FS_DBLOCK) |
4619 | type = GNUNET_BLOCK_TYPE_ANY; /* get on-demand blocks too! */ | 4619 | type = GNUNET_BLOCK_TYPE_ANY; /* get on-demand blocks too! */ |
4620 | pr->qe = GNUNET_DATASTORE_get (dsh, | 4620 | pr->qe = GNUNET_DATASTORE_iterate_key (dsh, |
4621 | &sm->query, | 4621 | &sm->query, |
4622 | type, | 4622 | type, |
4623 | -3, -1, | 4623 | -3, -1, |
4624 | GNUNET_CONSTANTS_SERVICE_TIMEOUT, | 4624 | GNUNET_CONSTANTS_SERVICE_TIMEOUT, |
4625 | &process_local_reply, | 4625 | &process_local_reply, |
4626 | pr); | 4626 | pr); |
4627 | } | 4627 | } |
4628 | 4628 | ||
4629 | 4629 | ||
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index c44a658df..16389e130 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -1047,7 +1047,7 @@ process_local_reply (void *cls, | |||
1047 | pr)) | 1047 | pr)) |
1048 | { | 1048 | { |
1049 | if (pr->qe != NULL) | 1049 | if (pr->qe != NULL) |
1050 | GNUNET_DATASTORE_get_next (GSF_dsh); | 1050 | GNUNET_DATASTORE_iterate_get_next (GSF_dsh); |
1051 | } | 1051 | } |
1052 | return; | 1052 | return; |
1053 | } | 1053 | } |
@@ -1070,7 +1070,7 @@ process_local_reply (void *cls, | |||
1070 | -1, -1, | 1070 | -1, -1, |
1071 | GNUNET_TIME_UNIT_FOREVER_REL, | 1071 | GNUNET_TIME_UNIT_FOREVER_REL, |
1072 | NULL, NULL); | 1072 | NULL, NULL); |
1073 | GNUNET_DATASTORE_get_next (GSF_dsh); | 1073 | GNUNET_DATASTORE_iterate_get_next (GSF_dsh); |
1074 | return; | 1074 | return; |
1075 | } | 1075 | } |
1076 | prq.type = type; | 1076 | prq.type = type; |
@@ -1112,7 +1112,7 @@ process_local_reply (void *cls, | |||
1112 | } | 1112 | } |
1113 | return; | 1113 | return; |
1114 | } | 1114 | } |
1115 | GNUNET_DATASTORE_get_next (GSF_dsh); | 1115 | GNUNET_DATASTORE_iterate_get_next (GSF_dsh); |
1116 | } | 1116 | } |
1117 | 1117 | ||
1118 | 1118 | ||
@@ -1132,20 +1132,20 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr, | |||
1132 | GNUNET_assert (NULL == pr->llc_cont); | 1132 | GNUNET_assert (NULL == pr->llc_cont); |
1133 | pr->llc_cont = cont; | 1133 | pr->llc_cont = cont; |
1134 | pr->llc_cont_cls = cont_cls; | 1134 | pr->llc_cont_cls = cont_cls; |
1135 | pr->qe = GNUNET_DATASTORE_get (GSF_dsh, | 1135 | pr->qe = GNUNET_DATASTORE_iterate_key (GSF_dsh, |
1136 | &pr->public_data.query, | 1136 | &pr->public_data.query, |
1137 | pr->public_data.type == GNUNET_BLOCK_TYPE_FS_DBLOCK | 1137 | pr->public_data.type == GNUNET_BLOCK_TYPE_FS_DBLOCK |
1138 | ? GNUNET_BLOCK_TYPE_ANY | 1138 | ? GNUNET_BLOCK_TYPE_ANY |
1139 | : pr->public_data.type, | 1139 | : pr->public_data.type, |
1140 | (0 != (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data.options)) | 1140 | (0 != (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data.options)) |
1141 | ? UINT_MAX | 1141 | ? UINT_MAX |
1142 | : 1 /* queue priority */, | 1142 | : 1 /* queue priority */, |
1143 | (0 != (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data.options)) | 1143 | (0 != (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data.options)) |
1144 | ? UINT_MAX | 1144 | ? UINT_MAX |
1145 | : 1 /* max queue size */, | 1145 | : 1 /* max queue size */, |
1146 | GNUNET_TIME_UNIT_FOREVER_REL, | 1146 | GNUNET_TIME_UNIT_FOREVER_REL, |
1147 | &process_local_reply, | 1147 | &process_local_reply, |
1148 | pr); | 1148 | pr); |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | 1151 | ||
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c index 094489273..c08b57020 100644 --- a/src/fs/gnunet-service-fs_push.c +++ b/src/fs/gnunet-service-fs_push.c | |||
@@ -507,7 +507,7 @@ process_migration_content (void *cls, | |||
507 | MIN_MIGRATION_CONTENT_LIFETIME.rel_value) | 507 | MIN_MIGRATION_CONTENT_LIFETIME.rel_value) |
508 | { | 508 | { |
509 | /* content will expire soon, don't bother */ | 509 | /* content will expire soon, don't bother */ |
510 | GNUNET_DATASTORE_get_next (GSF_dsh); | 510 | GNUNET_DATASTORE_iterate_get_next (GSF_dsh); |
511 | return; | 511 | return; |
512 | } | 512 | } |
513 | if (type == GNUNET_BLOCK_TYPE_FS_ONDEMAND) | 513 | if (type == GNUNET_BLOCK_TYPE_FS_ONDEMAND) |
@@ -519,7 +519,7 @@ process_migration_content (void *cls, | |||
519 | &process_migration_content, | 519 | &process_migration_content, |
520 | NULL)) | 520 | NULL)) |
521 | { | 521 | { |
522 | GNUNET_DATASTORE_get_next (GSF_dsh); | 522 | GNUNET_DATASTORE_iterate_get_next (GSF_dsh); |
523 | } | 523 | } |
524 | return; | 524 | return; |
525 | } | 525 | } |
@@ -556,7 +556,7 @@ process_migration_content (void *cls, | |||
556 | } | 556 | } |
557 | pos = pos->next; | 557 | pos = pos->next; |
558 | } | 558 | } |
559 | GNUNET_DATASTORE_get_next (GSF_dsh); | 559 | GNUNET_DATASTORE_iterate_get_next (GSF_dsh); |
560 | } | 560 | } |
561 | 561 | ||
562 | 562 | ||
diff --git a/src/fs/gnunet-service-fs_put.c b/src/fs/gnunet-service-fs_put.c index 5fd2ce81c..121a90bcd 100644 --- a/src/fs/gnunet-service-fs_put.c +++ b/src/fs/gnunet-service-fs_put.c | |||
@@ -109,7 +109,7 @@ static void | |||
109 | dht_put_continuation (void *cls, | 109 | dht_put_continuation (void *cls, |
110 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 110 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
111 | { | 111 | { |
112 | GNUNET_DATASTORE_get_next (GSF_dsh); | 112 | GNUNET_DATASTORE_iterate_get_next (GSF_dsh); |
113 | } | 113 | } |
114 | 114 | ||
115 | 115 | ||
@@ -198,11 +198,11 @@ gather_dht_put_blocks (void *cls, | |||
198 | return; | 198 | return; |
199 | if (dht_put_type == GNUNET_BLOCK_TYPE_FS_ONDEMAND) | 199 | if (dht_put_type == GNUNET_BLOCK_TYPE_FS_ONDEMAND) |
200 | dht_put_type = GNUNET_BLOCK_TYPE_FS_KBLOCK; | 200 | dht_put_type = GNUNET_BLOCK_TYPE_FS_KBLOCK; |
201 | dht_qe = GNUNET_DATASTORE_get_zero_anonymity (GSF_dsh, | 201 | dht_qe = GNUNET_DATASTORE_iterate_zero_anonymity (GSF_dsh, |
202 | 0, UINT_MAX, | 202 | 0, UINT_MAX, |
203 | GNUNET_TIME_UNIT_FOREVER_REL, | 203 | GNUNET_TIME_UNIT_FOREVER_REL, |
204 | dht_put_type++, | 204 | dht_put_type++, |
205 | &process_dht_put_content, NULL); | 205 | &process_dht_put_content, NULL); |
206 | GNUNET_assert (dht_qe != NULL); | 206 | GNUNET_assert (dht_qe != NULL); |
207 | } | 207 | } |
208 | 208 | ||