entry->inum = inum;
g_sequence_insert_sorted(range->map_entries, entry, compare, NULL);
- g_print("Created inode map entry for %"PRIu64"\n", inum);
+ if (bluesky_verbose)
+ g_print("Created inode map entry for %"PRIu64"\n", inum);
}
if (action != 0) {
if (range->serialized != NULL)
bluesky_cloudlog_erase(range->serialized);
+ GSequenceIter *j;
+ for (j = g_sequence_get_begin_iter(range->map_entries);
+ !g_sequence_iter_is_end(j); j = g_sequence_iter_next(j))
+ {
+ InodeMapEntry *entry = (InodeMapEntry *)g_sequence_get(j);
+ BlueSkyCloudLog *item = entry->item;
+ if (item != NULL) {
+ g_mutex_lock(item->lock);
+ if (g_atomic_int_get(&item->refcount) == 1) {
+ bluesky_cloudlog_erase(item);
+ }
+ g_mutex_unlock(item->lock);
+ } else {
+ g_warning("Null item for inode map entry %"PRIu64"!",
+ entry->inum);
+ }
+ }
+
i = g_sequence_iter_next(i);
}
}
return FALSE;
}
+ last = bluesky_string_dup(last);
+ bluesky_cloudlog_decrypt(last->data, last->len, fs->keys);
+
/* 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
* direct pointer; once we have the last commit record then all other data
g_mutex_unlock(commit->lock);
bluesky_inode_map_deserialize(fs, commit);
- //bluesky_cloudlog_unref(commit);
+ bluesky_cloudlog_unref(commit);
return TRUE;
}