Preparatory work before implementing proper cloud writing.
[bluesky.git] / bluesky / bluesky.h
index 9543d9c..f72c6d0 100644 (file)
@@ -96,6 +96,9 @@ typedef struct _BlueSkyStore BlueSkyStore;
 struct _BlueSkyLog;
 typedef struct _BlueSkyLog BlueSkyLog;
 
+struct _BlueSkyCloudLogState;
+typedef struct _BlueSkyCloudLogState BlueSkyCloudLogState;
+
 void bluesky_store_init();
 BlueSkyStore *bluesky_store_new(const gchar *type);
 void bluesky_store_free(BlueSkyStore *store);
@@ -130,6 +133,7 @@ typedef struct {
 
     BlueSkyStore *store;
     BlueSkyLog *log;
+    BlueSkyCloudLogState *log_state;
 
     /* Accounting for memory used for caches.  Space is measured in blocks, not
      * bytes.  We track both total data in the caches and dirty data (total
@@ -142,7 +146,9 @@ typedef struct {
      * avoid deadlock do not attempt to take any other locks while the FS lock
      * is held for list editing purposes.  Items at the head of the list are
      * most recently accessed/modified. */
-    GList dirty_list, accessed_list;
+    GList unlogged_list;        // Changes not yet synced to journal
+    GList dirty_list;           // Not yet written to cloud storage
+    GList accessed_list;        // All in-memory inodes
 
     /* Mutex for the flush daemon, to prevent concurrent execution. */
     GMutex *flushd_lock;
@@ -218,7 +224,7 @@ typedef struct {
      * dirty linked lists.  We re-use the GList structure, using ->next to
      * point to the head of the list and ->prev to point to the tail.  The data
      * element is unused. */
-    GList *accessed_list, *dirty_list;
+    GList *unlogged_list, *accessed_list, *dirty_list;
 
     int64_t atime;              /* Microseconds since the Unix epoch */
     int64_t ctime;