MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vm_map_entry_in_transition

Function vm_map_entry_in_transition

freebsd/vm/vm_map.c:3207–3246  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

3205 * 'start' position of the old entry.
3206 */
3207static vm_map_entry_t
3208vm_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:

Callers 2

vm_map_unwireFunction · 0.85
vm_map_wire_lockedFunction · 0.85

Calls 2

vm_map_lookup_entryFunction · 0.85
vm_map_entry_succFunction · 0.85

Tested by

no test coverage detected