+ sprintf(key, "inode-%016"PRIx64, inode->inum);
+
+ BlueSkyStoreAsync *async = bluesky_store_async_new(fs->store);
+ async->op = STORE_OP_PUT;
+ async->key = g_strdup(key);
+ async->data = data;
+ bluesky_store_async_submit(async);
+ if (barrier != NULL)
+ bluesky_store_add_barrier(barrier, async);
+ bluesky_store_async_unref(async);
+}
+
+/* Fetch an inode from stable storage. */
+void bluesky_inode_fetch(BlueSkyFS *fs, uint64_t inum)
+{
+ char key[64];
+ sprintf(key, "inode-%016"PRIx64, inum);
+ BlueSkyRCStr *data = bluesky_store_get(fs->store, key);
+ if (data == NULL)
+ return;
+
+ BlueSkyInode *inode = bluesky_deserialize_inode(fs, data->data);
+ if (inode != NULL) {
+ bluesky_insert_inode(fs, inode);
+ }
+}
+
+/* Synchronize filesystem superblock to stable storage. */
+void bluesky_superblock_flush(BlueSkyFS *fs)
+{
+ GString *buf = g_string_new("");
+ bluesky_serialize_superblock(buf, fs);
+ BlueSkyRCStr *data = bluesky_string_new_from_gstring(buf);
+
+ BlueSkyStoreAsync *async = bluesky_store_async_new(fs->store);
+ async->op = STORE_OP_PUT;
+ async->key = g_strdup("superblock");
+ async->data = data;
+ bluesky_store_async_submit(async);
+ bluesky_store_async_unref(async);