diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-11-05 18:21:50 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-11-05 18:21:50 +0000 |
commit | 75a33a1499cf60ea4364c9aa673816629a6c1413 (patch) | |
tree | 0620da4312bb04de4d7b65074fdd3b0c3dd6cc0e /src/fs/gnunet-service-fs_indexing.c | |
parent | 7217c601ad30760872823193d62307e7a335d226 (diff) | |
download | gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.tar.gz gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.zip |
big scheduler refactoring, expect some issues
Diffstat (limited to 'src/fs/gnunet-service-fs_indexing.c')
-rw-r--r-- | src/fs/gnunet-service-fs_indexing.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c index 99b5da102..2e95f454f 100644 --- a/src/fs/gnunet-service-fs_indexing.c +++ b/src/fs/gnunet-service-fs_indexing.c | |||
@@ -91,11 +91,6 @@ static struct IndexInfo *indexed_files; | |||
91 | static struct GNUNET_CONTAINER_MultiHashMap *ifm; | 91 | static struct GNUNET_CONTAINER_MultiHashMap *ifm; |
92 | 92 | ||
93 | /** | 93 | /** |
94 | * Our scheduler. | ||
95 | */ | ||
96 | static struct GNUNET_SCHEDULER_Handle *sched; | ||
97 | |||
98 | /** | ||
99 | * Our configuration. | 94 | * Our configuration. |
100 | */ | 95 | */ |
101 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 96 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
@@ -404,8 +399,7 @@ GNUNET_FS_handle_index_start (void *cls, | |||
404 | (unsigned int) mydev); | 399 | (unsigned int) mydev); |
405 | #endif | 400 | #endif |
406 | /* slow validation, need to hash full file (again) */ | 401 | /* slow validation, need to hash full file (again) */ |
407 | ii->fhc = GNUNET_CRYPTO_hash_file (sched, | 402 | ii->fhc = GNUNET_CRYPTO_hash_file (GNUNET_SCHEDULER_PRIORITY_IDLE, |
408 | GNUNET_SCHEDULER_PRIORITY_IDLE, | ||
409 | fn, | 403 | fn, |
410 | HASHING_BLOCKSIZE, | 404 | HASHING_BLOCKSIZE, |
411 | &hash_for_index_val, | 405 | &hash_for_index_val, |
@@ -710,7 +704,6 @@ shutdown_task (void *cls, | |||
710 | indexed_files = pos->next; | 704 | indexed_files = pos->next; |
711 | GNUNET_free (pos); | 705 | GNUNET_free (pos); |
712 | } | 706 | } |
713 | sched = NULL; | ||
714 | cfg = NULL; | 707 | cfg = NULL; |
715 | } | 708 | } |
716 | 709 | ||
@@ -718,21 +711,17 @@ shutdown_task (void *cls, | |||
718 | /** | 711 | /** |
719 | * Initialize the indexing submodule. | 712 | * Initialize the indexing submodule. |
720 | * | 713 | * |
721 | * @param s scheduler to use | ||
722 | * @param c configuration to use | 714 | * @param c configuration to use |
723 | * @param d datastore to use | 715 | * @param d datastore to use |
724 | */ | 716 | */ |
725 | int | 717 | int |
726 | GNUNET_FS_indexing_init (struct GNUNET_SCHEDULER_Handle *s, | 718 | GNUNET_FS_indexing_init (const struct GNUNET_CONFIGURATION_Handle *c, |
727 | const struct GNUNET_CONFIGURATION_Handle *c, | ||
728 | struct GNUNET_DATASTORE_Handle *d) | 719 | struct GNUNET_DATASTORE_Handle *d) |
729 | { | 720 | { |
730 | sched = s; | ||
731 | cfg = c; | 721 | cfg = c; |
732 | dsh = d; | 722 | dsh = d; |
733 | ifm = GNUNET_CONTAINER_multihashmap_create (128); | 723 | ifm = GNUNET_CONTAINER_multihashmap_create (128); |
734 | GNUNET_SCHEDULER_add_delayed (sched, | 724 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
735 | GNUNET_TIME_UNIT_FOREVER_REL, | ||
736 | &shutdown_task, | 725 | &shutdown_task, |
737 | NULL); | 726 | NULL); |
738 | read_index_list (); | 727 | read_index_list (); |