bluesky_cachefile_gc(fs);
g_mutex_unlock(fs->flushd_lock);
+ g_print("\nCloudlog cache: %d dirty, %d writeback, %d journal, %d cloud\n",
+ g_atomic_int_get(&fs->cache_log_dirty),
+ g_atomic_int_get(&fs->cache_log_writeback),
+ g_atomic_int_get(&fs->cache_log_journal),
+ g_atomic_int_get(&fs->cache_log_cloud));
+
return NULL;
}
* Once that is done, we can fall through the case of remapping the data
* itself. */
if (log->type == LOGTYPE_UNKNOWN) {
+ bluesky_cloudlog_stats_update(log, -1);
BlueSkyRCStr *raw = NULL;
if ((log->location_flags | log->pending_write) & CLOUDLOG_JOURNAL) {
raw = bluesky_log_map_object(log->fs, -1, log->log_seq,
g_assert(raw != NULL);
bluesky_deserialize_cloudlog(log, raw->data, raw->len);
bluesky_string_unref(raw);
+ bluesky_cloudlog_stats_update(log, 1);
}
/* At this point all metadata should be available and we need only remap
log->data = bluesky_string_new_from_gstring(buf);
bluesky_cloudlog_unref(range->serialized);
range->serialized = log;
+ bluesky_cloudlog_stats_update(log, 1);
}
BlueSkyCloudLog *bluesky_inode_map_serialize(BlueSkyFS *fs)
}
log->data = bluesky_string_new_from_gstring(buf);
+ bluesky_cloudlog_stats_update(log, 1);
if (updated) {
return log;
commit->location.offset = checkpoint - last->data;
commit->location.size = checkpoint_size;
g_mutex_unlock(commit->lock);
+ bluesky_cloudlog_stats_update(commit, 1);
bluesky_inode_map_deserialize(fs, commit);
bluesky_cloudlog_unref(commit);
BlueSkyCloudLog *marker = bluesky_cloudlog_new(fs, NULL);
marker->type = LOGTYPE_JOURNAL_MARKER;
marker->data = bluesky_string_new(g_strdup(""), 0);
+ bluesky_cloudlog_stats_update(marker, 1);
bluesky_cloudlog_sync(marker);
g_mutex_lock(marker->lock);
g_string_append_len(loc, (const gchar *)&seq, sizeof(seq));
g_string_append_len(loc, (const gchar *)&offset, sizeof(offset));
commit->data = bluesky_string_new_from_gstring(loc);
+ bluesky_cloudlog_stats_update(commit, 1);
bluesky_cloudlog_sync(commit);
g_mutex_lock(commit->lock);