diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_lookup.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 3153444..ea73d1a 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -129,6 +129,7 @@ int vfs_path_to_node(const char *path, struct vnode **vp) { struct vnode *vnode = g_root_vnode; + struct mount *mp; struct fs_info *fs; char *name; int s = 0, fs_caps = 0; @@ -139,6 +140,13 @@ vfs_path_to_node(const char *path, struct vnode **vp) return -EINVAL; } + /* See if we have a mountpoint with this name */ + name = vfs_get_fname_at(path, 0); + if (vfs_get_mp(name, &mp) == 0) { + fs = mp->fs; + vnode = fs->vnode; + } + /* Fetch filesystem capabilities if we can */ if (vnode->fs != NULL) { fs = vnode->fs; @@ -151,7 +159,7 @@ vfs_path_to_node(const char *path, struct vnode **vp) * it'll give us a vnode. */ if (__TEST(fs_caps, FSCAP_FULLPATH)) { - s = vfs_vget(g_root_vnode, path, &vnode); + s = vfs_vget(vnode, path, &vnode); goto done; } |