diff options
author | alc <alc@FreeBSD.org> | 2016-11-06 05:57:44 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2016-11-06 05:57:44 +0000 |
commit | 9bcd8df2bb0edef3188cb6d30133854b75a53acf (patch) | |
tree | 2030b73229fcbc7662673211296bb82e01dd393d /sys/vm | |
parent | f36185a6d4f24b4fed8da8b8fdde4950e7378513 (diff) | |
download | FreeBSD-src-9bcd8df2bb0edef3188cb6d30133854b75a53acf.zip FreeBSD-src-9bcd8df2bb0edef3188cb6d30133854b75a53acf.tar.gz |
MFC r308096, r308098, r308112
With one exception, "hardfault" is used like a "bool". Change that
exception and make it a "bool".
The "lookup_still_valid" field is used as a "bool". Make it one.
Convert vm_fault_hold()'s Boolean variables that are only used
internally to "bool". Add a comment describing why the one
remaining "boolean_t" was not converted.
Merge and sort vm_fault_hold()'s "int" variable definitions.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_fault.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index ed383bc..8e920a0 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -122,7 +122,7 @@ struct faultstate { vm_pindex_t first_pindex; vm_map_t map; vm_map_entry_t entry; - int lookup_still_valid; + bool lookup_still_valid; struct vnode *vp; }; @@ -148,7 +148,7 @@ unlock_map(struct faultstate *fs) if (fs->lookup_still_valid) { vm_map_lookup_done(fs->map, fs->entry); - fs->lookup_still_valid = FALSE; + fs->lookup_still_valid = false; } } @@ -291,24 +291,23 @@ vm_fault_hold(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, int fault_flags, vm_page_t *m_hold) { vm_prot_t prot; - int alloc_req, era, faultcount, nera, result; - boolean_t dead, growstack, is_first_object_locked, wired; - int map_generation; vm_object_t next_object; - int hardfault; struct faultstate fs; struct vnode *vp; vm_offset_t e_end, e_start; vm_page_t m; - int ahead, behind, cluster_offset, error, locked, rv; + int ahead, alloc_req, behind, cluster_offset, error, era, faultcount; + int locked, map_generation, nera, result, rv; u_char behavior; + boolean_t wired; /* Passed by reference. */ + bool dead, growstack, hardfault, is_first_object_locked; - hardfault = 0; - growstack = TRUE; PCPU_INC(cnt.v_vm_faults); fs.vp = NULL; faultcount = 0; nera = -1; + growstack = true; + hardfault = false; RetryFault:; @@ -325,7 +324,7 @@ RetryFault:; result = vm_map_growstack(curproc, vaddr); if (result != KERN_SUCCESS) return (KERN_FAILURE); - growstack = FALSE; + growstack = false; goto RetryFault; } unlock_vp(&fs); @@ -427,7 +426,7 @@ fast_failed: vm_object_reference_locked(fs.first_object); vm_object_pip_add(fs.first_object, 1); - fs.lookup_still_valid = TRUE; + fs.lookup_still_valid = true; fs.first_m = NULL; @@ -708,7 +707,7 @@ vnode_locked: &behind, &ahead); if (rv == VM_PAGER_OK) { faultcount = behind + 1 + ahead; - hardfault++; + hardfault = true; break; /* break to PAGE HAS BEEN FOUND */ } if (rv == VM_PAGER_ERROR) @@ -836,7 +835,7 @@ vnode_locked: * dirty in the first object so that it will go out * to swap when needed. */ - is_first_object_locked = FALSE; + is_first_object_locked = false; if ( /* * Only one shadow object @@ -941,7 +940,7 @@ vnode_locked: unlock_and_deallocate(&fs); goto RetryFault; } - fs.lookup_still_valid = TRUE; + fs.lookup_still_valid = true; if (fs.map->timestamp != map_generation) { result = vm_map_lookup_locked(&fs.map, vaddr, fault_type, &fs.entry, &retry_object, &retry_pindex, &retry_prot, &wired); |