rem: status = FS_CALL(vnode,fs_open_dir)(vnode->mount->cookie,vnode->priv_vnode,&cookie);
add: status = FS_CALL(vnode,fs_open_dir)(vnode->mount->cookie,vnode->private_node,&cookie);
context: dir_vnode_to_path(struct vnode *vnode, char *buffer, size_t bufferSize){	/* this implementation is currently bound to SYS_MAX_PATH_LEN */	char path[SYS_MAX_PATH_LEN];	int32 insert = sizeof(path);	int32 maxLevel = 256;	int32 length;	status_t status;	if (vnode == NULL || buffer == NULL)		return EINVAL;	// we don't use get_vnode() here because this call is more	// efficient and does all we need from get_vnode()	inc_vnode_ref_count(vnode);	path[--insert] = '\0';		while (true) {		// the name buffer is also used for fs_read_dir()		char nameBuffer[sizeof(struct dirent) + B_FILE_NAME_LENGTH];		char *name = &((struct dirent *)nameBuffer)->d_name[0];		vnode_id parentId, id;		// lookup the parent vnode		status = FS_CALL(vnode,fs_lookup)(vnode->mount->cookie,vnode->priv_vnode,"..",&parentId);		// Does the file system support getting the name of a vnode?		// If so, get it here...		if (status == B_OK && FS_CALL(vnode,fs_get_vnode_name))			status = FS_CALL(vnode,fs_get_vnode_name)(vnode->mount->cookie,vnode->priv_vnode,name,B_FILE_NAME_LENGTH);		// ... if not, find it out later (by iterating through		// the parent directory, searching for the id)		id = vnode->vnid;		// release the current vnode, we only need its parent from now on		put_vnode(vnode);		if (status < B_OK)			return status;		// don't go deeper as 'maxLevel' to prevent circular loops		if (maxLevel-- < 0)			return ELOOP;		if (parentId == vnode->vnid) {			// we have reached the root level directory of this file system			break;		}		// Get the parent vnode. The parent of the vnode may have already		// changed, though, which would result in an incorrect path		status = get_vnode(vnode->mount->id,parentId,&vnode,0);		if (status < B_OK)			return status;		if (!FS_CALL(vnode,fs_get_vnode_name)) {			// If we don't got the vnode's name yet, we have to search for it			// in the parent directory now			file_cookie cookie;			status = FS_CALL(vnode,fs_open_dir)(vnode->mount->cookie,vnode->priv_vnode,&cookie);			if (status >= B_OK) {				struct dirent *dirent = (struct dirent *)nameBuffer;				while (true) {					uint32 num = 1;					status = FS_CALL(vnode,fs_read_dir)(vnode->mount->cookie,vnode->priv_vnode,cookie,dirent,sizeof(nameBuffer),&num);					if (status < B_OK)						break;										if (id == dirent->d_ino)						// found correct entry!						break;				}				FS_CALL(vnode,fs_close_dir)(vnode->mount->cookie,vnode->priv_vnode,cookie);			}			if (status < B_OK) {				put_vnode(vnode);				return status;			}		}		// add the name infront of the current path		name[B_FILE_NAME_LENGTH - 1] = '\0';		length = strlen(name);		insert -= length;		if (insert <= 0) {			put_vnode(vnode);			return ENOBUFS;		}		memcpy(path + insert, name, length);		path[--insert] = '/';	}	// add the mountpoint	length = strlen(vnode->mount->mount_point);	if (bufferSize - (sizeof(path) - insert) < length + 1)		return ENOBUFS;	memcpy(buffer, vnode->mount->mount_point, length);	if (insert != sizeof(path))		memcpy(buffer + length, path + insert, sizeof(path) - insert);	return B_OK;}