aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-06-24 20:17:39 +0000
committerChristian Grothoff <christian@grothoff.org>2016-06-24 20:17:39 +0000
commit3140154d46212e08e0d73ed891a66213a6813075 (patch)
tree018a55a3899207664b388fcf47a679ca54ca6fbf /src/fs
parentd5fd881c2a044474b54ddf03b6ab8be8d2b75927 (diff)
downloadgnunet-3140154d46212e08e0d73ed891a66213a6813075.tar.gz
gnunet-3140154d46212e08e0d73ed891a66213a6813075.zip
refactoring datastore API to use MQ API, also fixing misc. bugs in new mysql backend
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/fs_publish.c3
-rw-r--r--src/fs/fs_publish_ublock.c1
-rw-r--r--src/fs/fs_unindex.c5
-rw-r--r--src/fs/gnunet-service-fs_cadet_server.c1
-rw-r--r--src/fs/gnunet-service-fs_indexing.c8
-rw-r--r--src/fs/gnunet-service-fs_pr.c8
-rw-r--r--src/fs/gnunet-service-fs_push.c1
-rw-r--r--src/fs/gnunet-service-fs_put.c1
8 files changed, 6 insertions, 22 deletions
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index 530a7ac9b..89cc2714c 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -266,7 +266,6 @@ publish_sblocks_cont (void *cls,
266 { 266 {
267 pc->qre = 267 pc->qre =
268 GNUNET_DATASTORE_release_reserve (pc->dsh, pc->rid, UINT_MAX, UINT_MAX, 268 GNUNET_DATASTORE_release_reserve (pc->dsh, pc->rid, UINT_MAX, UINT_MAX,
269 GNUNET_TIME_UNIT_FOREVER_REL,
270 &finish_release_reserve, pc); 269 &finish_release_reserve, pc);
271 } 270 }
272 else 271 else
@@ -526,7 +525,6 @@ block_proc (void *cls,
526 p->bo.replication_level, 525 p->bo.replication_level,
527 p->bo.expiration_time, 526 p->bo.expiration_time,
528 -2, 1, 527 -2, 1,
529 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
530 &ds_put_cont, pc); 528 &ds_put_cont, pc);
531 return; 529 return;
532 } 530 }
@@ -547,7 +545,6 @@ block_proc (void *cls,
547 p->bo.replication_level, 545 p->bo.replication_level,
548 p->bo.expiration_time, 546 p->bo.expiration_time,
549 -2, 1, 547 -2, 1,
550 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
551 &ds_put_cont, 548 &ds_put_cont,
552 pc); 549 pc);
553} 550}
diff --git a/src/fs/fs_publish_ublock.c b/src/fs/fs_publish_ublock.c
index 9ea7bf41b..7de9ea689 100644
--- a/src/fs/fs_publish_ublock.c
+++ b/src/fs/fs_publish_ublock.c
@@ -294,7 +294,6 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h,
294 bo->replication_level, 294 bo->replication_level,
295 bo->expiration_time, 295 bo->expiration_time,
296 -2, 1, 296 -2, 1,
297 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
298 &ublock_put_cont, uc); 297 &ublock_put_cont, uc);
299 } 298 }
300 else 299 else
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c
index 2e9c17217..2c4cb6ae6 100644
--- a/src/fs/fs_unindex.c
+++ b/src/fs/fs_unindex.c
@@ -215,7 +215,7 @@ unindex_process (void *cls,
215 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 215 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
216 "Sending REMOVE request to DATASTORE service\n"); 216 "Sending REMOVE request to DATASTORE service\n");
217 GNUNET_DATASTORE_remove (uc->dsh, &chk->query, size, data, -2, 1, 217 GNUNET_DATASTORE_remove (uc->dsh, &chk->query, size, data, -2, 1,
218 GNUNET_CONSTANTS_SERVICE_TIMEOUT, &process_cont, uc); 218 &process_cont, uc);
219 uc->chk = *chk; 219 uc->chk = *chk;
220} 220}
221 221
@@ -552,7 +552,6 @@ process_kblock_for_unindex (void *cls,
552 data, 552 data,
553 0 /* priority */, 553 0 /* priority */,
554 1 /* queue size */, 554 1 /* queue size */,
555 GNUNET_TIME_UNIT_FOREVER_REL,
556 &continue_after_remove, 555 &continue_after_remove,
557 uc); 556 uc);
558 return; 557 return;
@@ -563,7 +562,6 @@ process_kblock_for_unindex (void *cls,
563 GNUNET_BLOCK_TYPE_FS_UBLOCK, 562 GNUNET_BLOCK_TYPE_FS_UBLOCK,
564 0 /* priority */, 563 0 /* priority */,
565 1 /* queue size */, 564 1 /* queue size */,
566 GNUNET_TIME_UNIT_FOREVER_REL,
567 &process_kblock_for_unindex, 565 &process_kblock_for_unindex,
568 uc); 566 uc);
569} 567}
@@ -615,7 +613,6 @@ GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc)
615 GNUNET_BLOCK_TYPE_FS_UBLOCK, 613 GNUNET_BLOCK_TYPE_FS_UBLOCK,
616 0 /* priority */, 614 0 /* priority */,
617 1 /* queue size */, 615 1 /* queue size */,
618 GNUNET_TIME_UNIT_FOREVER_REL,
619 &process_kblock_for_unindex, 616 &process_kblock_for_unindex,
620 uc); 617 uc);
621} 618}
diff --git a/src/fs/gnunet-service-fs_cadet_server.c b/src/fs/gnunet-service-fs_cadet_server.c
index ccf6b3c5c..c9d838fef 100644
--- a/src/fs/gnunet-service-fs_cadet_server.c
+++ b/src/fs/gnunet-service-fs_cadet_server.c
@@ -445,7 +445,6 @@ request_cb (void *cls,
445 ntohl (sqm->type), 445 ntohl (sqm->type),
446 0 /* priority */, 446 0 /* priority */,
447 GSF_datastore_queue_size, 447 GSF_datastore_queue_size,
448 GNUNET_TIME_UNIT_FOREVER_REL,
449 &handle_datastore_reply, sc); 448 &handle_datastore_reply, sc);
450 if (NULL == sc->qe) 449 if (NULL == sc->qe)
451 { 450 {
diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c
index 9687b24bc..87de0986d 100644
--- a/src/fs/gnunet-service-fs_indexing.c
+++ b/src/fs/gnunet-service-fs_indexing.c
@@ -523,7 +523,7 @@ GNUNET_FS_handle_on_demand_block (const struct GNUNET_HashCode * key, uint32_t s
523 { 523 {
524 GNUNET_break (0); 524 GNUNET_break (0);
525 GNUNET_DATASTORE_remove (dsh, key, size, data, -1, -1, 525 GNUNET_DATASTORE_remove (dsh, key, size, data, -1, -1,
526 GNUNET_TIME_UNIT_FOREVER_REL, &remove_cont, NULL); 526 &remove_cont, NULL);
527 return GNUNET_SYSERR; 527 return GNUNET_SYSERR;
528 } 528 }
529 odb = (const struct OnDemandBlock *) data; 529 odb = (const struct OnDemandBlock *) data;
@@ -542,7 +542,7 @@ GNUNET_FS_handle_on_demand_block (const struct GNUNET_HashCode * key, uint32_t s
542 ("# index blocks removed: original file inaccessible"), 542 ("# index blocks removed: original file inaccessible"),
543 1, GNUNET_YES); 543 1, GNUNET_YES);
544 GNUNET_DATASTORE_remove (dsh, key, size, data, -1, -1, 544 GNUNET_DATASTORE_remove (dsh, key, size, data, -1, -1,
545 GNUNET_TIME_UNIT_FOREVER_REL, &remove_cont, NULL); 545 &remove_cont, NULL);
546 return GNUNET_SYSERR; 546 return GNUNET_SYSERR;
547 } 547 }
548 if ((NULL == 548 if ((NULL ==
@@ -560,7 +560,7 @@ GNUNET_FS_handle_on_demand_block (const struct GNUNET_HashCode * key, uint32_t s
560 if (fh != NULL) 560 if (fh != NULL)
561 GNUNET_DISK_file_close (fh); 561 GNUNET_DISK_file_close (fh);
562 GNUNET_DATASTORE_remove (dsh, key, size, data, -1, -1, 562 GNUNET_DATASTORE_remove (dsh, key, size, data, -1, -1,
563 GNUNET_TIME_UNIT_FOREVER_REL, &remove_cont, NULL); 563 &remove_cont, NULL);
564 return GNUNET_SYSERR; 564 return GNUNET_SYSERR;
565 } 565 }
566 GNUNET_DISK_file_close (fh); 566 GNUNET_DISK_file_close (fh);
@@ -574,7 +574,7 @@ GNUNET_FS_handle_on_demand_block (const struct GNUNET_HashCode * key, uint32_t s
574 _("Indexed file `%s' changed at offset %llu\n"), fn, 574 _("Indexed file `%s' changed at offset %llu\n"), fn,
575 (unsigned long long) off); 575 (unsigned long long) off);
576 GNUNET_DATASTORE_remove (dsh, key, size, data, -1, -1, 576 GNUNET_DATASTORE_remove (dsh, key, size, data, -1, -1,
577 GNUNET_TIME_UNIT_FOREVER_REL, &remove_cont, NULL); 577 &remove_cont, NULL);
578 return GNUNET_SYSERR; 578 return GNUNET_SYSERR;
579 } 579 }
580 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 580 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index a7a62a743..d82b2a954 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -1149,7 +1149,6 @@ handle_dht_reply (void *cls,
1149 1 /* anonymity */ , 1149 1 /* anonymity */ ,
1150 0 /* replication */ , 1150 0 /* replication */ ,
1151 exp, 1 + prq.priority, MAX_DATASTORE_QUEUE, 1151 exp, 1 + prq.priority, MAX_DATASTORE_QUEUE,
1152 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
1153 &put_migration_continuation, pmc)) 1152 &put_migration_continuation, pmc))
1154 { 1153 {
1155 put_migration_continuation (pmc, 1154 put_migration_continuation (pmc,
@@ -1472,7 +1471,6 @@ process_local_reply (void *cls,
1472 pr->public_data.options)) ? UINT_MAX : 1471 pr->public_data.options)) ? UINT_MAX :
1473 GSF_datastore_queue_size 1472 GSF_datastore_queue_size
1474 /* max queue size */ , 1473 /* max queue size */ ,
1475 GNUNET_TIME_UNIT_FOREVER_REL,
1476 &process_local_reply, pr); 1474 &process_local_reply, pr);
1477 if (NULL != pr->qe) 1475 if (NULL != pr->qe)
1478 return; /* we're done */ 1476 return; /* we're done */
@@ -1492,7 +1490,7 @@ process_local_reply (void *cls,
1492 { 1490 {
1493 GNUNET_break (0); 1491 GNUNET_break (0);
1494 GNUNET_DATASTORE_remove (GSF_dsh, key, size, data, -1, -1, 1492 GNUNET_DATASTORE_remove (GSF_dsh, key, size, data, -1, -1,
1495 GNUNET_TIME_UNIT_FOREVER_REL, NULL, NULL); 1493 NULL, NULL);
1496 pr->qe_start = GNUNET_TIME_absolute_get (); 1494 pr->qe_start = GNUNET_TIME_absolute_get ();
1497 pr->warn_task = 1495 pr->warn_task =
1498 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, 1496 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
@@ -1512,7 +1510,6 @@ process_local_reply (void *cls,
1512 pr->public_data.options)) ? UINT_MAX : 1510 pr->public_data.options)) ? UINT_MAX :
1513 GSF_datastore_queue_size 1511 GSF_datastore_queue_size
1514 /* max queue size */ , 1512 /* max queue size */ ,
1515 GNUNET_TIME_UNIT_FOREVER_REL,
1516 &process_local_reply, pr); 1513 &process_local_reply, pr);
1517 if (NULL == pr->qe) 1514 if (NULL == pr->qe)
1518 { 1515 {
@@ -1574,7 +1571,6 @@ process_local_reply (void *cls,
1574 public_data.options)) ? UINT_MAX : 1571 public_data.options)) ? UINT_MAX :
1575 GSF_datastore_queue_size 1572 GSF_datastore_queue_size
1576 /* max queue size */ , 1573 /* max queue size */ ,
1577 GNUNET_TIME_UNIT_FOREVER_REL,
1578 &process_local_reply, pr); 1574 &process_local_reply, pr);
1579 /* check if we successfully queued another datastore request; 1575 /* check if we successfully queued another datastore request;
1580 * if so, return, otherwise call our continuation (if we have 1576 * if so, return, otherwise call our continuation (if we have
@@ -1681,7 +1677,6 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr,
1681 public_data.options)) ? UINT_MAX : 1677 public_data.options)) ? UINT_MAX :
1682 GSF_datastore_queue_size 1678 GSF_datastore_queue_size
1683 /* max queue size */ , 1679 /* max queue size */ ,
1684 GNUNET_TIME_UNIT_FOREVER_REL,
1685 &process_local_reply, pr); 1680 &process_local_reply, pr);
1686 if (NULL != pr->qe) 1681 if (NULL != pr->qe)
1687 return; 1682 return;
@@ -1795,7 +1790,6 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
1795 prq.priority, 1 /* anonymity */ , 1790 prq.priority, 1 /* anonymity */ ,
1796 0 /* replication */ , 1791 0 /* replication */ ,
1797 expiration, 1 + prq.priority, MAX_DATASTORE_QUEUE, 1792 expiration, 1 + prq.priority, MAX_DATASTORE_QUEUE,
1798 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
1799 &put_migration_continuation, pmc)) 1793 &put_migration_continuation, pmc))
1800 { 1794 {
1801 put_migration_continuation (pmc, 1795 put_migration_continuation (pmc,
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c
index d7a15fad6..71a8e81e4 100644
--- a/src/fs/gnunet-service-fs_push.c
+++ b/src/fs/gnunet-service-fs_push.c
@@ -582,7 +582,6 @@ gather_migration_blocks (void *cls)
582 value_found = GNUNET_NO; 582 value_found = GNUNET_NO;
583 mig_qe = 583 mig_qe =
584 GNUNET_DATASTORE_get_for_replication (GSF_dsh, 0, UINT_MAX, 584 GNUNET_DATASTORE_get_for_replication (GSF_dsh, 0, UINT_MAX,
585 GNUNET_TIME_UNIT_FOREVER_REL,
586 &process_migration_content, NULL); 585 &process_migration_content, NULL);
587 if (NULL == mig_qe) 586 if (NULL == mig_qe)
588 consider_gathering (); 587 consider_gathering ();
diff --git a/src/fs/gnunet-service-fs_put.c b/src/fs/gnunet-service-fs_put.c
index 3517c7b24..bb4cb4ecb 100644
--- a/src/fs/gnunet-service-fs_put.c
+++ b/src/fs/gnunet-service-fs_put.c
@@ -225,7 +225,6 @@ gather_dht_put_blocks (void *cls)
225 po->dht_qe = 225 po->dht_qe =
226 GNUNET_DATASTORE_get_zero_anonymity (GSF_dsh, po->current_offset++, 0, 226 GNUNET_DATASTORE_get_zero_anonymity (GSF_dsh, po->current_offset++, 0,
227 UINT_MAX, 227 UINT_MAX,
228 GNUNET_TIME_UNIT_FOREVER_REL,
229 po->dht_put_type, 228 po->dht_put_type,
230 &process_dht_put_content, po); 229 &process_dht_put_content, po);
231 if (NULL == po->dht_qe) 230 if (NULL == po->dht_qe)