From: Michael Vrable Date: Tue, 10 Aug 2010 00:36:17 +0000 (-0700) Subject: Drop old code for flushing data to the cloud. X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=3ef3101470ca56b40f80adc708ff5cb7e78beaee;p=bluesky.git Drop old code for flushing data to the cloud. --- diff --git a/bluesky/bluesky-private.h b/bluesky/bluesky-private.h index b420169..bc3df37 100644 --- a/bluesky/bluesky-private.h +++ b/bluesky/bluesky-private.h @@ -235,7 +235,6 @@ void bluesky_cloudlog_ref(BlueSkyCloudLog *log); void bluesky_cloudlog_unref(BlueSkyCloudLog *log); void bluesky_cloudlog_sync(BlueSkyCloudLog *log); void bluesky_cloudlog_insert(BlueSkyCloudLog *log); -void bluesky_cloudlog_write_log(BlueSkyFS *fs); void bluesky_cloudlog_fetch(BlueSkyCloudLog *log); BlueSkyCloudPointer bluesky_cloudlog_serialize(BlueSkyCloudLog *log, BlueSkyFS *fs); diff --git a/bluesky/cloudlog.c b/bluesky/cloudlog.c index 134f3d7..76776b4 100644 --- a/bluesky/cloudlog.c +++ b/bluesky/cloudlog.c @@ -234,18 +234,6 @@ BlueSkyCloudPointer bluesky_cloudlog_serialize(BlueSkyCloudLog *log, return log->location; } -static void find_inodes(gpointer key, gpointer value, gpointer user_data) -{ - BlueSkyCloudLogState *state = (BlueSkyCloudLogState *)user_data; - BlueSkyCloudLog *item = (BlueSkyCloudLog *)value; - - if (item->type != LOGTYPE_INODE) - return; - - bluesky_cloudlog_ref(item); - state->inode_list = g_list_prepend(state->inode_list, item); -} - /* Finish up a partially-written cloud log segment and flush it to storage. */ void bluesky_cloudlog_flush(BlueSkyFS *fs) { @@ -271,27 +259,3 @@ void bluesky_cloudlog_flush(BlueSkyFS *fs) state->location.offset = 0; state->data = g_string_new(""); } - -void bluesky_cloudlog_write_log(BlueSkyFS *fs) -{ - BlueSkyCloudLogState *state = fs->log_state; - if (state->data == NULL) - state->data = g_string_new(""); - - g_mutex_lock(fs->lock); - g_hash_table_foreach(fs->locations, find_inodes, state); - g_mutex_unlock(fs->lock); - - while (state->inode_list != NULL) { - BlueSkyCloudLog *log = (BlueSkyCloudLog *)state->inode_list->data; - bluesky_cloudlog_serialize(log, fs); - bluesky_cloudlog_unref(log); - state->inode_list = g_list_delete_link(state->inode_list, - state->inode_list); - - if (state->data->len > CLOUDLOG_SEGMENT_SIZE) - bluesky_cloudlog_flush(fs); - } - - bluesky_cloudlog_flush(fs); -}