rem: curr_v = root_vnode; inc_vnode_ref_count(curr_v);
add: vnode = root_vnode; inc_vnode_ref_count(vnode);
context: path_to_vnode(char *path, struct vnode **v, bool kernel){	char *p = path;	char *next_p;	struct vnode *curr_v;	struct vnode *next_v;	vnode_id vnid;	int err = 0;	if (!p)		return EINVAL;	// figure out if we need to start at root or at cwd	if (*p == '/') {		while (*++p == '/')			;		curr_v = root_vnode;		inc_vnode_ref_count(curr_v);	} else {		struct io_context *ioctx = get_current_io_context(kernel);		mutex_lock(&ioctx->io_mutex);		curr_v = ioctx->cwd;		inc_vnode_ref_count(curr_v);		mutex_unlock(&ioctx->io_mutex);	}	for (;;) {//		dprintf("path_to_vnode: top of loop. p 0x%x, *p = %c, p = '%s'\n", p, *p, p);		// done?		if (*p == '\0') {			err = 0;			break;		}		// walk to find the next component		for (next_p = p+1; *next_p != '\0' && *next_p != '/'; next_p++);		if (*next_p == '/') {			*next_p = '\0';			do				next_p++;			while (*next_p == '/');		}		// see if the .. is at the root of a mount		if (strcmp("..", p) == 0 && curr_v->mount->root_vnode == curr_v) {			// move to the covered vnode so we pass the '..' parse to the underlying filesystem			if (curr_v->mount->covers_vnode) {				next_v = curr_v->mount->covers_vnode;				inc_vnode_ref_count(next_v);				dec_vnode_ref_count(curr_v, true, false);				curr_v = next_v;			}		}		// tell the filesystem to parse this path		err = curr_v->mount->fs->calls->fs_lookup(curr_v->mount->cookie, curr_v->priv_vnode, p, &vnid);		if (err < 0) {			dec_vnode_ref_count(curr_v, true, false);			goto out;		}		// 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(&vfs_vnode_mutex);		next_v = lookup_vnode(curr_v->fsid, vnid);		mutex_unlock(&vfs_vnode_mutex);		if (!next_v) {			// pretty screwed up here			panic("path_to_vnode: could not lookup vnode (fsid 0x%x vnid 0x%Lx)\n", curr_v->fsid, vnid);			err = ERR_VFS_PATH_NOT_FOUND;			dec_vnode_ref_count(curr_v, true, false);			goto out;		}		// decrease the ref count on the old dir we just looked up into		dec_vnode_ref_count(curr_v, true, false);		p = next_p;		curr_v = next_v;		// see if we hit a mount point		if (curr_v->covered_by) {			next_v = curr_v->covered_by;			inc_vnode_ref_count(next_v);			dec_vnode_ref_count(curr_v, true, false);			curr_v = next_v;		}	}	*v = curr_v;out:	return err;}