From: Minep Date: Mon, 3 Oct 2022 21:11:00 +0000 (+0100) Subject: fix: remove unnecessary backtracing in mnt_mkbusy/chillax X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/commitdiff_plain/ddb4e08c76afcae5e40e0bcb418683dfb2a22aa8?hp=91a0b918696959a351b7c98ee386d05ac0526bf9 fix: remove unnecessary backtracing in mnt_mkbusy/chillax fix: no need to do subtree reposition after symlink is resolved (for now). --- diff --git a/lunaix-os/kernel/fs/mount.c b/lunaix-os/kernel/fs/mount.c index ff8d46b..c1e9784 100644 --- a/lunaix-os/kernel/fs/mount.c +++ b/lunaix-os/kernel/fs/mount.c @@ -68,25 +68,17 @@ __vfs_do_unmount(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) { - 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 diff --git a/lunaix-os/kernel/fs/path_walk.c b/lunaix-os/kernel/fs/path_walk.c index c80d713..a0331e7 100644 --- a/lunaix-os/kernel/fs/path_walk.c +++ b/lunaix-os/kernel/fs/path_walk.c @@ -106,7 +106,7 @@ __vfs_walk(struct v_dnode* start, } // 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; }