Rework caching of data blocks to eliminate double-caching.
[bluesky.git] / bluesky / bluesky-private.h
index 0f86f45..418c1e5 100644 (file)
@@ -165,6 +165,7 @@ typedef struct {
 } BlueSkyCloudPointer;
 
 typedef enum {
+    LOGTYPE_INVALID = -1,
     LOGTYPE_UNKNOWN = 0,
     LOGTYPE_DATA = 1,
     LOGTYPE_INODE = 2,
@@ -209,8 +210,11 @@ struct _BlueSkyCloudLog {
     // Pointers to other objects
     GArray *pointers;
 
-    // Serialized data, if available in memory (otherwise NULL).
+    // Serialized data, if available in memory (otherwise NULL), and a lock
+    // count which tracks if there are users that require the data to be kept
+    // around.
     BlueSkyRCStr *data;
+    int data_lock_count;
 };
 
 /* Serialize objects into a log segment to be written to the cloud. */