bluesky_string_ref(block->data);
g_mutex_unlock(block->cloudref->lock);
block->type = BLUESKY_BLOCK_CACHED;
+ g_atomic_int_add(&inode->fs->cache_total, 1);
}
/* Write the given block to cloud-backed storage and mark it clean. */
b->type = BLUESKY_BLOCK_REF;
g_atomic_int_add(&inode->fs->cache_total, -1);
g_mutex_lock(b->cloudref->lock);
- bluesky_string_unref(b->cloudref->data);
- b->cloudref->data = NULL;
+ if (b->cloudref->location_flags & CLOUDLOG_JOURNAL) {
+ bluesky_string_unref(b->cloudref->data);
+ b->cloudref->data = NULL;
+ }
g_mutex_unlock(b->cloudref->lock);
}
}