Add locking, thread-ID tracking to profiling.
[bluesky.git] / bluesky / imap.c
index ec27d43..7181a1e 100644 (file)
@@ -250,6 +250,7 @@ static void bluesky_inode_map_deserialize(BlueSkyFS *fs, BlueSkyCloudLog *imap)
             InodeMapEntry *entry;
             entry = bluesky_inode_map_lookup(fs->inode_map, *inum, 1);
             entry->inum = GUINT64_FROM_LE(*inum);
+            bluesky_cloudlog_unref_delayed(entry->item);
             entry->item = g_array_index(section->links,
                                         BlueSkyCloudLog *, j);
             bluesky_cloudlog_ref(entry->item);
@@ -282,7 +283,7 @@ gboolean bluesky_checkpoint_load(BlueSkyFS *fs)
     }
 
     last = bluesky_string_dup(last);
-    bluesky_cloudlog_decrypt(last->data, last->len, fs->keys);
+    bluesky_cloudlog_decrypt(last->data, last->len, fs->keys, NULL);
 
     /* Scan through the contents of the last log segment to find a checkpoint
      * record.  We need to do a linear scan since at this point we don't have a
@@ -314,6 +315,10 @@ gboolean bluesky_checkpoint_load(BlueSkyFS *fs)
         len -= size;
     }
 
+    if (checkpoint_size == 0) {
+        g_error("Unable to locate checkpoint record!\n");
+    }
+
     g_print("Found checkpoint record at %zd (size %zd)\n",
             checkpoint - last->data, checkpoint_size);