*/
static const struct GNUNET_CONFIGURATION_Handle *cfg;
+/**
+ * Datastore handle. Created and destroyed by code in
+ * gnunet-service-fs (this is an alias).
+ */
+static struct GNUNET_DATASTORE_Handle *dsh;
+
/**
* Write the current index information list to disk.
ii->filename = (const char*) &ii[1];
memcpy (&ii[1], fn, slen);
ii->file_id = ism->file_id;
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Received `%s' message for file `%s'\n",
+ "START_INDEX",
+ ii->filename);
+#endif
+
ii->tc = GNUNET_SERVER_transmit_context_create (client);
mydev = 0;
myino = 0;
if (size != sizeof (struct OnDemandBlock))
{
GNUNET_break (0);
- GNUNET_FS_drq_remove (key,
- size,
- data,
- &remove_cont,
- NULL,
- GNUNET_TIME_UNIT_FOREVER_REL);
+ GNUNET_DATASTORE_remove (dsh,
+ key,
+ size,
+ data,
+ -1, -1,
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ &remove_cont,
+ NULL);
return GNUNET_SYSERR;
}
odb = (const struct OnDemandBlock*) data;
sizeof (ndata)))) )
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- _("Could not access indexed file `%s' at offset %llu: %s\n"),
+ _("Could not access indexed file `%s' (%s) at offset %llu: %s\n"),
GNUNET_h2s (&odb->file_id),
+ fn,
(unsigned long long) off,
STRERROR (errno));
if (fh != NULL)
GNUNET_DISK_file_close (fh);
- GNUNET_FS_drq_remove (key,
- size,
- data,
- &remove_cont,
- NULL,
- GNUNET_TIME_UNIT_FOREVER_REL);
+ GNUNET_DATASTORE_remove (dsh,
+ key,
+ size,
+ data,
+ -1, -1,
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ &remove_cont,
+ NULL);
return GNUNET_SYSERR;
}
GNUNET_DISK_file_close (fh);
_("Indexed file `%s' changed at offset %llu\n"),
fn,
(unsigned long long) off);
- GNUNET_FS_drq_remove (key,
- size,
- data,
- &remove_cont,
- NULL,
- GNUNET_TIME_UNIT_FOREVER_REL);
+ GNUNET_DATASTORE_remove (dsh,
+ key,
+ size,
+ data,
+ -1, -1,
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ &remove_cont,
+ NULL);
return GNUNET_SYSERR;
}
#if DEBUG_FS
*
* @param s scheduler to use
* @param c configuration to use
+ * @param d datastore to use
*/
int
GNUNET_FS_indexing_init (struct GNUNET_SCHEDULER_Handle *s,
- const struct GNUNET_CONFIGURATION_Handle *c)
+ const struct GNUNET_CONFIGURATION_Handle *c,
+ struct GNUNET_DATASTORE_Handle *d)
{
sched = s;
cfg = c;
+ dsh = d;
ifm = GNUNET_CONTAINER_multihashmap_create (128);
GNUNET_SCHEDULER_add_delayed (sched,
GNUNET_TIME_UNIT_FOREVER_REL,