Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Oct 2016 21:01:49 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r308098 - head/sys/vm
Message-ID:  <201610292101.u9TL1nKP080353@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Sat Oct 29 21:01:49 2016
New Revision: 308098
URL: https://svnweb.freebsd.org/changeset/base/308098

Log:
  The "lookup_is_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.
  
  Reviewed by:	kib
  MFC after:	8 days

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==============================================================================
--- head/sys/vm/vm_fault.c	Sat Oct 29 20:01:48 2016	(r308097)
+++ head/sys/vm/vm_fault.c	Sat Oct 29 21:01:49 2016	(r308098)
@@ -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;
 	}
 }
 
@@ -292,7 +292,6 @@ vm_fault_hold(vm_map_t map, vm_offset_t 
 {
 	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;
 	struct faultstate fs;
@@ -301,13 +300,14 @@ vm_fault_hold(vm_map_t map, vm_offset_t 
 	vm_page_t m;
 	int ahead, behind, cluster_offset, error, locked, rv;
 	u_char behavior;
-	bool hardfault;
+	boolean_t wired;	/* Passed by reference. */
+	bool dead, growstack, hardfault, is_first_object_locked;
 
-	growstack = TRUE;
 	PCPU_INC(cnt.v_vm_faults);
 	fs.vp = NULL;
 	faultcount = 0;
 	nera = -1;
+	growstack = true;
 	hardfault = false;
 
 RetryFault:;
@@ -325,7 +325,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 +427,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;
 
@@ -836,7 +836,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 +941,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610292101.u9TL1nKP080353>