/* TODO: Locking? Since we're reading a single variable this is probably
* atomic but a lock could be safer. */
+ BlueSkyCloudLog *marker = bluesky_log_get_commit_point(fs);
int journal_seq_start = fs->log->seq_num;
while (1) {
g_mutex_lock(fs->lock);
}
+ /* Write out any updated inode map entries, so that all inodes just written
+ * can be located, and then a final commit record. */
+ BlueSkyCloudLog *commit_record = bluesky_inode_map_serialize(fs);
+ bluesky_cloudlog_serialize(commit_record, fs);
+
g_mutex_unlock(fs->lock);
bluesky_cloudlog_flush(fs);
fs->log_state->pending_segments);
}
+ bluesky_log_write_commit_point(fs, marker);
+
g_print("All segments have been flushed, journal < %d is clean\n",
journal_seq_start);