fix: remove unnecessary backtracing in mnt_mkbusy/chillax
authorMinep <zelong56@gmail.com>
Mon, 3 Oct 2022 21:11:00 +0000 (22:11 +0100)
committerMinep <zelong56@gmail.com>
Mon, 3 Oct 2022 21:11:00 +0000 (22:11 +0100)
fix: no need to do subtree reposition after symlink is resolved (for now).

lunaix-os/kernel/fs/mount.c
lunaix-os/kernel/fs/path_walk.c

index ff8d46b5bb91a3a1ca8e32e9bdf28a7c26087592..c1e9784bef642dfc4302445bf2a1e0b172b0665a 100644 (file)
@@ -68,25 +68,17 @@ __vfs_do_unmount(struct v_mount* mnt)
 void
 mnt_mkbusy(struct v_mount* mnt)
 {
 void
 mnt_mkbusy(struct v_mount* mnt)
 {
-    while (mnt) {
-        mutex_lock(&mnt->lock);
-        mnt->busy_counter++;
-        mutex_unlock(&mnt->lock);
-
-        mnt = mnt->parent;
-    }
+    mutex_lock(&mnt->lock);
+    mnt->busy_counter++;
+    mutex_unlock(&mnt->lock);
 }
 
 void
 mnt_chillax(struct v_mount* mnt)
 {
 }
 
 void
 mnt_chillax(struct v_mount* mnt)
 {
-    while (mnt) {
-        mutex_lock(&mnt->lock);
-        mnt->busy_counter--;
-        mutex_unlock(&mnt->lock);
-
-        mnt = mnt->parent;
-    }
+    mutex_lock(&mnt->lock);
+    mnt->busy_counter--;
+    mutex_unlock(&mnt->lock);
 }
 
 int
 }
 
 int
index c80d7134d22596d89a7f53addcfb59929c3da8a5..a0331e70139d644b1a4657d2c9d64aaa404bfe04 100644 (file)
@@ -106,7 +106,7 @@ __vfs_walk(struct v_dnode* start,
             }
 
             // reposition the resolved subtree pointed by symlink
             }
 
             // reposition the resolved subtree pointed by symlink
-            vfs_dcache_rehash(current_level->parent, dnode);
+            // vfs_dcache_rehash(current_level->parent, dnode);
             current_level = dnode;
             current_inode = dnode->inode;
         }
             current_level = dnode;
             current_inode = dnode->inode;
         }