Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_map.c
Show First 20 Lines • Show All 2,463 Lines • ▼ Show 20 Lines | for (current = entry; current->start < end; | ||||
if (current->eflags & MAP_ENTRY_IS_SUB_MAP) { | if (current->eflags & MAP_ENTRY_IS_SUB_MAP) { | ||||
vm_map_unlock(map); | vm_map_unlock(map); | ||||
return (KERN_INVALID_ARGUMENT); | return (KERN_INVALID_ARGUMENT); | ||||
} | } | ||||
if ((new_prot & current->max_protection) != new_prot) { | if ((new_prot & current->max_protection) != new_prot) { | ||||
vm_map_unlock(map); | vm_map_unlock(map); | ||||
return (KERN_PROTECTION_FAILURE); | return (KERN_PROTECTION_FAILURE); | ||||
} | } | ||||
if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0) | if ((current->eflags & MAP_ENTRY_IN_TRANSITION) != 0) | ||||
in_tran = entry; | in_tran = current; | ||||
} | } | ||||
/* | /* | ||||
* Postpone the operation until all in transition map entries | * Postpone the operation until all in transition map entries | ||||
* are stabilized. In-transition entry might already have its | * are stabilized. In-transition entry might already have its | ||||
* pages wired and wired_count incremented, but | * pages wired and wired_count incremented, but | ||||
* MAP_ENTRY_USER_WIRED flag not yet set, and visible to other | * MAP_ENTRY_USER_WIRED flag not yet set, and visible to other | ||||
* threads because the map lock is dropped. In this case we | * threads because the map lock is dropped. In this case we | ||||
* would miss our call to vm_fault_copy_entry(). | * would miss our call to vm_fault_copy_entry(). | ||||
*/ | */ | ||||
if (in_tran != NULL) { | if (in_tran != NULL) { | ||||
alc: " ... but not yet have its MAP_ENTRY_USER_WIRED flag set and visible ... | |||||
in_tran->eflags |= MAP_ENTRY_NEEDS_WAKEUP; | in_tran->eflags |= MAP_ENTRY_NEEDS_WAKEUP; | ||||
vm_map_unlock_and_wait(map, 0); | vm_map_unlock_and_wait(map, 0); | ||||
Not Done Inline ActionsI think that the "and" clause can simply be deleted. In other worlds, we can simply say, "... flag set. In which case, we would fail to ..." alc: I think that the "and" clause can simply be deleted. In other worlds, we can simply say, "... | |||||
goto again; | goto again; | ||||
} | } | ||||
/* | /* | ||||
* Before changing the protections, try to reserve swap space for any | * Before changing the protections, try to reserve swap space for any | ||||
* private (i.e., copy-on-write) mappings that are transitioning from | * private (i.e., copy-on-write) mappings that are transitioning from | ||||
* read-only to read/write access. If a reservation fails, break out | * read-only to read/write access. If a reservation fails, break out | ||||
* of this loop early and let the next loop simplify the entries, since | * of this loop early and let the next loop simplify the entries, since | ||||
▲ Show 20 Lines • Show All 2,481 Lines • Show Last 20 Lines |
" ... but not yet have its MAP_ENTRY_USER_WIRED flag set and visible ...