rem: curr_ioctx = get_current_io_context(kernel); mutex_lock(&curr_ioctx->io_mutex);
add: io = get_current_io_context(kernel); mutex_lock(&io->io_mutex);
context: vfs_set_cwd(char* path, bool kernel){	struct io_context* curr_ioctx;	struct vnode* v = NULL;	struct vnode* old_cwd;	struct stat stat;	int rc;#if MAKE_NOIZE	dprintf("vfs_set_cwd: path=\'%s\'\n", path);#endif	// Get vnode for passed path, and bail if it failed	rc = path_to_vnode(path, &v, kernel);	if (rc < 0) {		goto err;	}	rc = v->mount->fs->calls->fs_rstat(v->mount->cookie, v->priv_vnode, &stat);	if(rc < 0) {		goto err1;	}	if(!S_ISDIR(stat.st_mode)) {		// nope, can't cwd to here		rc = ERR_VFS_WRONG_STREAM_TYPE;		goto err1;	}	// Get current io context and lock	curr_ioctx = get_current_io_context(kernel);	mutex_lock(&curr_ioctx->io_mutex);	// save the old cwd	old_cwd = curr_ioctx->cwd;	// Set the new vnode	curr_ioctx->cwd = v;	// Unlock the ioctx	mutex_unlock(&curr_ioctx->io_mutex);	// Decrease ref count of previous working dir (as the ref is being replaced)	if (old_cwd)		dec_vnode_ref_count(old_cwd, true, false);	return B_NO_ERROR;err1:	dec_vnode_ref_count(v, true, false);err:	return rc;}