rem: new_vnode = rootfs_find_in_dir(dir, name); if (new_vnode == NULL) { dprintf("rootfs_create: creating new vnode\n"); new_vnode = rootfs_create_vnode(fs); if (new_vnode == NULL) { err = ENOMEM; goto err; } created_vnode = true; new_vnode->name = kstrdup(name); if (new_vnode->name == NULL) { err = ENOMEM; goto err1; } new_vnode->parent = dir; rootfs_insert_in_dir(dir, new_vnode);  hash_insert(fs->vnode_list_hash, new_vnode);  s = &new_vnode->stream; } else {  err = ERR_VFS_ALREADY_EXISTS;
add: vnode = rootfs_find_in_dir(dir, name); if (vnode != NULL) { status = B_FILE_EXISTS;
context: rootfs_create_dir(fs_cookie _fs, fs_vnode _dir, const char *name, int perms, vnode_id *new_vnid){	struct rootfs *fs = _fs;	struct rootfs_vnode *dir = _dir;	struct rootfs_vnode *new_vnode;	struct rootfs_stream *s;	int err = 0;	bool created_vnode = false;	TRACE(("rootfs_create: dir 0x%x, name = '%s', stream_type = %d\n", dir, name, st));	mutex_lock(&fs->lock);	new_vnode = rootfs_find_in_dir(dir, name);	if (new_vnode == NULL) {		dprintf("rootfs_create: creating new vnode\n");		new_vnode = rootfs_create_vnode(fs);		if (new_vnode == NULL) {			err = ENOMEM;			goto err;		}		created_vnode = true;		new_vnode->name = kstrdup(name);		if (new_vnode->name == NULL) {			err = ENOMEM;			goto err1;		}		new_vnode->parent = dir;		rootfs_insert_in_dir(dir, new_vnode);		hash_insert(fs->vnode_list_hash, new_vnode);		s = &new_vnode->stream;	} else {		// we found the vnode		err = ERR_VFS_ALREADY_EXISTS;		goto err;	}	new_vnode->stream.dir.dir_head = NULL;	new_vnode->stream.dir.jar_head = NULL;	mutex_unlock(&fs->lock);	return 0;err1:	if (created_vnode)		rootfs_delete_vnode(fs, new_vnode, false);err:	mutex_unlock(&fs->lock);	return err;}