rem: struct vnode *mountPoint = resolve_volume_root_to_mount_point(vnode);
add: struct vnode *mountPoint = resolve_mount_point_to_volume_root(vnode);
context: vnode_path_to_vnode(struct vnode *vnode, char *path, bool traverseLeafLink,	int count, struct vnode **_vnode, int *_type){	status_t status = 0;	int type = 0;	FUNCTION(("vnode_path_to_vnode(vnode = %p, path = %s)\n", vnode, path));	if (!path)		return B_BAD_VALUE;	while (true) {		struct vnode *nextVnode;		vnode_id vnodeID;		char *nextPath;		PRINT(("vnode_path_to_vnode: top of loop. p = %p, p = '%s'\n", path, path));		// done?		if (path[0] == '\0')			break;		// walk to find the next path component ("path" will point to a single		// path component), and filter out multiple slashes		for (nextPath = path + 1; *nextPath != '\0' && *nextPath != '/'; nextPath++);		if (*nextPath == '/') {			*nextPath = '\0';			do				nextPath++;			while (*nextPath == '/');		}		// See if the '..' is at the root of a mount and move to the covered		// vnode so we pass the '..' path to the underlying filesystem		if (!strcmp("..", path)			&& vnode->mount->root_vnode == vnode			&& vnode->mount->covers_vnode) {			nextVnode = vnode->mount->covers_vnode;			inc_vnode_ref_count(nextVnode);			put_vnode(vnode);			vnode = nextVnode;		}		// Check if we have the right to search the current directory vnode.		// If a file system doesn't have the access() function, we assume that		// searching a directory is always allowed		if (FS_CALL(vnode, access))			status = FS_CALL(vnode, access)(vnode->mount->cookie, vnode->private_node, X_OK);		// Tell the filesystem to get the vnode of this path component (if we got the		// permission from the call above)		if (status >= B_OK)			status = FS_CALL(vnode, lookup)(vnode->mount->cookie, vnode->private_node, path, &vnodeID, &type);		if (status < B_OK) {			put_vnode(vnode);			return status;		}		// Lookup the vnode, the call to fs_lookup should have caused a get_vnode to be called		// from inside the filesystem, thus the vnode would have to be in the list and it's		// ref count incremented at this point		mutex_lock(&sVnodeMutex);		nextVnode = lookup_vnode(vnode->device, vnodeID);		mutex_unlock(&sVnodeMutex);		if (!nextVnode) {			// pretty screwed up here - the file system found the vnode, but the hash			// lookup failed, so our internal structures are messed up			panic("path_to_vnode: could not lookup vnode (mountid 0x%lx vnid 0x%Lx)\n", vnode->device, vnodeID);			put_vnode(vnode);			return B_ENTRY_NOT_FOUND;		}		// If the new node is a symbolic link, resolve it (if we've been told to do it)		if (S_ISLNK(type) && !(!traverseLeafLink && nextPath[0] == '\0')) {			char *buffer;			PRINT(("traverse link\n"));			// it's not exactly nice style using goto in this way, but hey, it works :-/			if (count + 1 > MAX_SYM_LINKS) {				status = B_LINK_LIMIT;				goto resolve_link_error;			}			buffer = (char *)malloc(SYS_MAX_PATH_LEN);			if (buffer == NULL) {				status = B_NO_MEMORY;				goto resolve_link_error;			}			status = FS_CALL(nextVnode, read_link)(nextVnode->mount->cookie, nextVnode->private_node, buffer, SYS_MAX_PATH_LEN);			if (status < B_OK) {				free(buffer);		resolve_link_error:				put_vnode(vnode);				put_vnode(nextVnode);				return status;			}			put_vnode(nextVnode);			// Check if we start from the root directory or the current			// directory ("vnode" still points to that one).			// Cut off all leading slashes if it's the root directory			path = buffer;			if (path[0] == '/') {				// we don't need the old directory anymore				put_vnode(vnode);				while (*++path == '/')					;				vnode = sRoot;				inc_vnode_ref_count(vnode);			}			inc_vnode_ref_count(vnode);				// balance the next recursion - we will decrement the ref_count				// of the vnode, no matter if we succeeded or not			status = vnode_path_to_vnode(vnode, path, traverseLeafLink, count + 1, &nextVnode, _type);			free(buffer);			if (status < B_OK) {				put_vnode(vnode);				return status;			}		}		// decrease the ref count on the old dir we just looked up into		put_vnode(vnode);		path = nextPath;		vnode = nextVnode;		// see if we hit a mount point		struct vnode *mountPoint = resolve_volume_root_to_mount_point(vnode);		if (mountPoint) {			put_vnode(vnode);			vnode = mountPoint;		}	}	*_vnode = vnode;	if (_type)		*_type = type;	return B_OK;}