rem: static int rootfs_rename(fs_cookie _fs, fs_vnode _olddir, const char *oldname, fs_vnode _newdir, const char *newname)
add: rootfs_rename(fs_cookie _fs, fs_vnode _olddir, const char *oldname, fs_vnode _newdir, const char *newname)
context: static int rootfs_rename(fs_cookie _fs, fs_vnode _olddir, const char *oldname, fs_vnode _newdir, const char *newname){	struct rootfs *fs = _fs;	struct rootfs_vnode *olddir = _olddir;	struct rootfs_vnode *newdir = _newdir;	struct rootfs_vnode *v1, *v2;	int err;	TRACE(("rootfs_rename: olddir 0x%x (0x%x 0x%x), oldname '%s', newdir 0x%x (0x%x 0x%x), newname '%s'\n",		olddir, olddir->id, oldname, newdir, newdir->id, newname));	mutex_lock(&fs->lock);	v1 = rootfs_find_in_dir(olddir, oldname);	if(!v1) {		err = ERR_VFS_PATH_NOT_FOUND;		goto err;	}	v2 = rootfs_find_in_dir(newdir, newname);	if(olddir == newdir) {		// rename to a different name in the same dir		if(v2) {			// target node exists			err = ERR_VFS_ALREADY_EXISTS;			goto err;		}		// change the name on this node		if(strlen(oldname) >= strlen(newname)) {			// reuse the old name buffer			strcpy(v1->name, newname);		} else {			char *ptr = v1->name;			v1->name = kstrdup(newname);			if(!v1->name) {				// bad place to be, at least restore				v1->name = ptr;				err = ENOMEM;				goto err;			}			kfree(ptr);		}		/* no need to remove and add it unless the dir is sorting */#if 0		// remove it from the dir		rootfs_remove_from_dir(olddir, v1);		// add it back to the dir with the new name		rootfs_insert_in_dir(newdir, v1);#endif	} else {		// different target dir from source		rootfs_remove_from_dir(olddir, v1);		rootfs_insert_in_dir(newdir, v1);	}	err = 0;err:	mutex_unlock(&fs->lock);	return err;}