Drop old code for flushing data to the cloud.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Tue, 10 Aug 2010 00:36:17 +0000 (17:36 -0700)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Tue, 10 Aug 2010 00:36:17 +0000 (17:36 -0700)
bluesky/bluesky-private.h
bluesky/cloudlog.c

index b420169..bc3df37 100644 (file)
@@ -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);
index 134f3d7..76776b4 100644 (file)
@@ -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);
-}