X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/96cf56ea15a22b8b362aac6c3ab202d2608e9151..f13e160f6aa2f74895ecf1f65099265643836210:/lunaix-os/kernel/fs/path_walk.c diff --git a/lunaix-os/kernel/fs/path_walk.c b/lunaix-os/kernel/fs/path_walk.c index ea5b1c5..cd0ac01 100644 --- a/lunaix-os/kernel/fs/path_walk.c +++ b/lunaix-os/kernel/fs/path_walk.c @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -33,7 +34,10 @@ __vfs_walk(struct v_dnode* start, panick("vfs: no root"); } } - i++; + + if (path[0] == VFS_PATH_DELIM) { + i++; + } } assert(start); @@ -71,9 +75,7 @@ __vfs_walk(struct v_dnode* start, if (!lookahead && (walk_options & VFS_WALK_PARENT)) { if (component) { - component->hash = name.hash; - component->len = j; - strcpy(component->value, fname_buffer); + hstrcpy(component, &name); } break; } @@ -105,7 +107,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; }