Add partial journal replay to filesystem recovery.
[bluesky.git] / bluesky / cache.c
index 454e06f..c27d39d 100644 (file)
@@ -114,6 +114,7 @@ static void flushd_cloud(BlueSkyFS *fs)
 
     /* 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) {
@@ -177,6 +178,8 @@ static void flushd_cloud(BlueSkyFS *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);