use rb-tree for directory lookups
[dragonfly.git] / sys / vfs / tmpfs / tmpfs_vfsops.c
index 4aa5eb1..de23cb7 100644 (file)
@@ -351,8 +351,8 @@ tmpfs_unmount(struct mount *mp, int mntflags)
                if (node->tn_type == VDIR) {
                        struct tmpfs_dirent *de;
 
-                       while (!TAILQ_EMPTY(&node->tn_dir.tn_dirhead)) {
-                               de = TAILQ_FIRST(&node->tn_dir.tn_dirhead);
+                       while (!RB_EMPTY(&node->tn_dir.tn_dirtree)) {
+                               de = RB_FIRST(tmpfs_dirtree, &node->tn_dir.tn_dirtree);
                                tmpfs_dir_detach(node, de);
                                tmpfs_free_dirent(tmp, de);
                                node->tn_size -= sizeof(struct tmpfs_dirent);