+void bluesky_cloudlog_fetch(BlueSkyCloudLog *log);
+BlueSkyCloudPointer bluesky_cloudlog_serialize(BlueSkyCloudLog *log,
+ BlueSkyFS *fs);
+void bluesky_cloudlog_flush(BlueSkyFS *fs);
+
+/* Logging infrastructure for ensuring operations are persistently recorded to
+ * disk. */
+#define BLUESKY_CRC32C_SEED (~(uint32_t)0)
+uint32_t crc32c(uint32_t crc, const char *buf, unsigned int length);
+uint32_t crc32c_finalize(uint32_t crc);
+
+struct _BlueSkyLog {
+ char *log_directory;
+ GAsyncQueue *queue;
+ int fd, dirfd;
+ int seq_num;
+ GSList *committed;
+
+ /* Cache of log segments which have been memory-mapped. */
+ GMutex *mmap_lock;
+ GHashTable *mmap_cache;
+};
+
+/* Reference-counted blocks of memory, used for passing data in and out of
+ * storage backends and in other places. This may also refer to read-only
+ * mmaped data. */
+struct _BlueSkyMmap {
+ gint refcount;
+ int log_seq;
+ const char *addr;
+ size_t len;
+ BlueSkyLog *log;
+};
+
+BlueSkyLog *bluesky_log_new(const char *log_directory);
+void bluesky_log_item_submit(BlueSkyCloudLog *item, BlueSkyLog *log);
+void bluesky_log_finish_all(GList *log_items);
+BlueSkyRCStr *bluesky_log_map_object(BlueSkyLog *log, int log_seq,
+ int log_offset, int log_size);
+void bluesky_mmap_unref(BlueSkyMmap *mmap);