Attempt at limiting the rate at which memory is dirtied.
[bluesky.git] / bluesky / inode.c
index f3b804d..2696713 100644 (file)
@@ -55,6 +55,9 @@ void bluesky_inode_update_ctime(BlueSkyInode *inode, gboolean update_mtime)
     bluesky_list_unlink(&inode->fs->accessed_list, inode->accessed_list);
     inode->accessed_list = bluesky_list_prepend(&inode->fs->accessed_list, inode);
     g_mutex_unlock(inode->fs->lock);
+
+    bluesky_cloudlog_unref(inode->committed_item);
+    inode->committed_item = NULL;
 }
 
 /* Unfortunately a glib hash table is only guaranteed to be able to store
@@ -88,6 +91,7 @@ BlueSkyFS *bluesky_new_fs(gchar *name)
     fs->next_inum = BLUESKY_ROOT_INUM + 1;
     fs->store = bluesky_store_new("file");
     fs->flushd_lock = g_mutex_new();
+    fs->flushd_cond = g_cond_new();
     fs->locations = g_hash_table_new(bluesky_cloudlog_hash,
                                      bluesky_cloudlog_equal);