Add very rudimentary eviction data blocks from the cache.
[bluesky.git] / bluesky / inode.c
index cfa6697..55781ca 100644 (file)
@@ -92,6 +92,7 @@ BlueSkyFS *bluesky_init_fs(gchar *name, BlueSkyStore *store)
             fs->name = g_strdup(name);
             return fs;
         }
+        bluesky_string_unref(data);
     }
 
     g_print("Initializing fresh filesystem\n");
@@ -196,6 +197,10 @@ BlueSkyInode *bluesky_get_inode(BlueSkyFS *fs, uint64_t inum)
 
     if (inode != NULL) {
         bluesky_inode_ref(inode);
+
+        /* FIXME: We assume we can atomically update the in-memory access time
+         * without a lock. */
+        inode->access_time = bluesky_get_current_time();
     }
 
     g_mutex_unlock(fs->lock);
@@ -312,6 +317,8 @@ void bluesky_inode_fetch(BlueSkyFS *fs, uint64_t inum)
     if (bluesky_options.sync_inode_fetches) {
         bluesky_store_async_wait(async);
     }
+
+    bluesky_store_async_unref(async);
 }
 
 /* Synchronize filesystem superblock to stable storage. */