+ lru_remove(dnode_lru, &vfs_sysroot->lru);
+}
+
+void
+vfs_vncache_init(struct vncache* cache)
+{
+ cache->pool = vzalloc(VFS_HASHTABLE_SIZE * sizeof(struct hbucket));
+ rwlock_init(&cache->lock);
+}
+
+void
+vfs_vncache_free(struct vncache* cache)
+{
+ // clear all other reader/writer
+ rwlock_begin_write(&cache->lock);
+ vfree(cache->pool);
+
+ // already freed, so as the lock
+}
+
+void
+vfs_vncache_add(struct vncache* cache, size_t key, struct hlist_node* node)
+{
+ struct hbucket* slot;
+
+ cache_atomic_write(cache,
+ {
+ slot = &cache->pool[key & VFS_HASH_MASK];
+ hlist_delete(node);
+ hlist_add(&slot->head, node);
+ });