Add LRU lists for tracking inodes that are dirty/accessed.
[bluesky.git] / bluesky / debug.c
index 312a0e1..7cdd4fd 100644 (file)
@@ -45,5 +45,17 @@ void bluesky_debug_dump(BlueSkyFS *fs)
     g_print("Cached inodes: %u\tNext inode: %"PRIu64"\n",
             g_hash_table_size(fs->inodes), fs->next_inum);
 
+    GList *item;
+    g_print("Dirty inode LRU list:");
+    for (item = fs->dirty_list.next; item != NULL; item = item->next) {
+        g_print(" %"PRIu64";", ((BlueSkyInode *)item->data)->inum);
+    }
+    g_print("\n");
+    g_print("Accessed inode LRU list:");
+    for (item = fs->accessed_list.next; item != NULL; item = item->next) {
+        g_print(" %"PRIu64";", ((BlueSkyInode *)item->data)->inum);
+    }
+    g_print("\n");
+
     g_hash_table_foreach(fs->inodes, inode_dump, fs);
 }