* vm_map_entry_in_transition: * * Release the map lock, and sleep until the entry is no longer in * transition. Awake and acquire the map lock. If the map changed while * another held the lock, lookup a possibly-changed entry at or after the * 'start' position of the old entry. */
| 3205 | * 'start' position of the old entry. |
| 3206 | */ |
| 3207 | static vm_map_entry_t |
| 3208 | vm_map_entry_in_transition(vm_map_t map, vm_offset_t in_start, |
| 3209 | vm_offset_t *io_end, bool holes_ok, vm_map_entry_t in_entry) |
| 3210 | { |
| 3211 | vm_map_entry_t entry; |
| 3212 | vm_offset_t start; |
| 3213 | u_int last_timestamp; |
| 3214 | |
| 3215 | VM_MAP_ASSERT_LOCKED(map); |
| 3216 | KASSERT((in_entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0, |
| 3217 | ("not in-tranition map entry %p", in_entry)); |
| 3218 | /* |
| 3219 | * We have not yet clipped the entry. |
| 3220 | */ |
| 3221 | start = MAX(in_start, in_entry->start); |
| 3222 | in_entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; |
| 3223 | last_timestamp = map->timestamp; |
| 3224 | if (vm_map_unlock_and_wait(map, 0)) { |
| 3225 | /* |
| 3226 | * Allow interruption of user wiring/unwiring? |
| 3227 | */ |
| 3228 | } |
| 3229 | vm_map_lock(map); |
| 3230 | if (last_timestamp + 1 == map->timestamp) |
| 3231 | return (in_entry); |
| 3232 | |
| 3233 | /* |
| 3234 | * Look again for the entry because the map was modified while it was |
| 3235 | * unlocked. Specifically, the entry may have been clipped, merged, or |
| 3236 | * deleted. |
| 3237 | */ |
| 3238 | if (!vm_map_lookup_entry(map, start, &entry)) { |
| 3239 | if (!holes_ok) { |
| 3240 | *io_end = start; |
| 3241 | return (NULL); |
| 3242 | } |
| 3243 | entry = vm_map_entry_succ(entry); |
| 3244 | } |
| 3245 | return (entry); |
| 3246 | } |
| 3247 | |
| 3248 | /* |
| 3249 | * vm_map_unwire: |
no test coverage detected