From 9a11448fbde0b9467623a3874095cd71cc2631a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 13 Apr 2006 18:06:30 +0000 Subject: [PATCH] vfs_get_fs_node_from_path() didn't work correctly and ignored the mount_id (ie. it only worked for absolute paths, but it shouldn't work for those at all). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17127 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/fs/vfs.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 468c014083..754e1d4d3c 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -2750,11 +2750,21 @@ vfs_get_fs_node_from_path(mount_id mountID, const char *path, bool kernel, void if (pathBuffer.InitCheck() != B_OK) return B_NO_MEMORY; + fs_mount *mount; + status_t status = get_mount(mountID, &mount); + if (status < B_OK) + return status; + char *buffer = pathBuffer.LockBuffer(); strlcpy(buffer, path, pathBuffer.BufferSize()); - struct vnode *vnode; - status_t status = path_to_vnode(buffer, true, &vnode, NULL, kernel); + struct vnode *vnode = mount->root_vnode; + inc_vnode_ref_count(vnode); + + status = vnode_path_to_vnode(vnode, buffer, true, 0, &vnode, NULL, NULL); + + put_mount(mount); + if (status < B_OK) return status;