A much better fix will depend on reworking this code a bit more.
BlueSkyCloudLog *log2
= (BlueSkyCloudLog *)g_hash_table_lookup(log->fs->locations, &id);
// TODO: refcount
BlueSkyCloudLog *log2
= (BlueSkyCloudLog *)g_hash_table_lookup(log->fs->locations, &id);
// TODO: refcount
- g_mutex_unlock(log->fs->lock);
+ bluesky_cloudlog_ref(log2);
+ g_mutex_unlock(log->fs->lock);
bluesky_cloudlog_serialize(log2, state);
bluesky_cloudlog_serialize(log2, state);
+ bluesky_cloudlog_unref(log2);
+ g_mutex_lock(log->lock);
+ bluesky_cloudlog_fetch(log);
g_assert(log->data != NULL);
log->location = state->location;
g_assert(log->data != NULL);
log->location = state->location;
g_string_append_len(state->data, log->data->data, log->data->len);
log->location_flags |= CLOUDLOG_CLOUD;
g_string_append_len(state->data, log->data->data, log->data->len);
log->location_flags |= CLOUDLOG_CLOUD;
+ g_mutex_unlock(log->lock);
b->type = BLUESKY_BLOCK_REF;
g_atomic_int_add(&inode->fs->cache_total, -1);
g_mutex_lock(b->cloudref->lock);
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);
}
}
g_mutex_unlock(b->cloudref->lock);
}
}
#include "bluesky-private.h"
#include "bluesky-private.h"
-int bluesky_verbose = 1;
+int bluesky_verbose = 0;
BlueSkyOptions bluesky_options;
BlueSkyOptions bluesky_options;