rem: vm_region *region; vm_region *next;
context: vm_delete_aspace(aspace_id aid){	vm_region *region;	vm_region *next;	vm_address_space *aspace;	aspace = vm_get_aspace_by_id(aid);	if (aspace == NULL)		return ERR_VM_INVALID_ASPACE;	TRACE(("vm_delete_aspace: called on aspace 0x%lx\n", aid));	// put this aspace in the deletion state	// this guarantees that no one else will add regions to the list	acquire_sem_etc(aspace->virtual_map.sem, WRITE_COUNT, 0, 0);	if (aspace->state == VM_ASPACE_STATE_DELETION) {		// abort, someone else is already deleting this aspace		release_sem_etc(aspace->virtual_map.sem, WRITE_COUNT, 0);		vm_put_aspace(aspace);		return B_NO_ERROR;	}	aspace->state = VM_ASPACE_STATE_DELETION;	// delete all the regions in this aspace	region = aspace->virtual_map.region_list;	while (region) {		next = region->aspace_next;				if (region->id == RESERVED_REGION_ID) {			// just remove it			free(region);			region = next;			continue;		}		// decrement the ref on this region, may actually push the ref < 0, but that's okay		_vm_put_region(region, true);		region = next;	}	// unlock	release_sem_etc(aspace->virtual_map.sem, WRITE_COUNT, 0);	// release two refs on the address space	vm_put_aspace(aspace);	vm_put_aspace(aspace);	return B_NO_ERROR;}