Add a prefetch method. At the moment it is a no-op.
[bluesky.git] / bluesky / cloudlog.c
index a37776a..7730d0e 100644 (file)
@@ -268,6 +268,16 @@ BlueSkyCloudLog *bluesky_cloudlog_get(BlueSkyFS *fs, BlueSkyCloudID id)
     return item;
 }
 
+/* Attempt to prefetch a cloud log item.  This does not guarantee that it will
+ * be made available, but does make it more likely that a future call to
+ * bluesky_cloudlog_fetch will complete quickly. */
+void bluesky_cloudlog_prefetch(BlueSkyCloudLog *log)
+{
+    gchar *id = bluesky_cloudlog_id_to_string(log->id);
+    g_print("Prefetch for %s\n", id);
+    g_free(id);
+}
+
 /* Ensure that a cloud log item is loaded in memory, and if not read it in.
  * TODO: Make asynchronous, and make this also fetch from the cloud.  Right now
  * we only read from the log.  Log item must be locked. */