X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Fcloudlog.c;h=196eeb810c67fb2a38a2bee50af90eb101c0056d;hb=b8885660a453f0f1f30c9fed196b01a397482a19;hp=3809b00b0d8faf6ed59bff7ac7648de3a04f13ee;hpb=c0d52390142a72a89aa632172e03a3ec909890ed;p=bluesky.git diff --git a/bluesky/cloudlog.c b/bluesky/cloudlog.c index 3809b00..196eeb8 100644 --- a/bluesky/cloudlog.c +++ b/bluesky/cloudlog.c @@ -158,6 +158,8 @@ void bluesky_cloudlog_unref(BlueSkyCloudLog *log) } g_array_unref(log->links); bluesky_string_unref(log->data); + if (log->dirty_journal != NULL) + g_atomic_int_add(&log->dirty_journal->dirty_refs, -1); g_free(log); } } @@ -260,8 +262,14 @@ BlueSkyCloudPointer bluesky_cloudlog_serialize(BlueSkyCloudLog *log, g_string_append_len(state->data, (const char *)&header, sizeof(header)); g_string_append_len(state->data, log->data->data, log->data->len); + /* TODO: We should mark the objects as committed on the cloud until the + * data is flushed and acknowledged. */ log->location_flags |= CLOUDLOG_CLOUD; bluesky_cloudlog_stats_update(log, 1); + if (log->dirty_journal != NULL) { + g_atomic_int_add(&log->dirty_journal->dirty_refs, -1); + log->dirty_journal = NULL; + } g_mutex_unlock(log->lock); if (state->data->len > CLOUDLOG_SEGMENT_SIZE)