Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Mar 2006 00:52:06 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 93328 for review
Message-ID:  <200603150052.k2F0q6DZ005770@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=93328

Change 93328 by peter@peter_melody on 2006/03/15 00:51:25

	Use an if() rather than a goto.  Code body is otherwise
	unchanged besides the indent.

Affected files ...

.. //depot/projects/hammer/sys/amd64/amd64/pmap.c#141 edit

Differences ...

==== //depot/projects/hammer/sys/amd64/amd64/pmap.c#141 (text+ko) ====

@@ -1589,28 +1589,27 @@
 	if (pv_entry_count > pv_entry_high_water)
 		pagedaemon_wakeup();
 	pc = TAILQ_FIRST(&pmap->pm_pvchunk);
-	if (pc == NULL)
-		goto alloc;
-	for (field = 0; field < _NPCM; field++) {
-		bit = -1;
-		if (pc->pc_map[field])
-			bit = bsfq(pc->pc_map[field]);
-		if (bit >= 0)
-			break;
-	}
-	if (bit >= 0) {
-		pv = &pc->pc_pventry[field * 64 + bit];
-		pc->pc_map[field] &= ~(1ul << bit);
-		/* If this was the last item, move it to tail */
-		if (pc->pc_map[0] == 0 && pc->pc_map[1] == 0 &&
-		    pc->pc_map[2] == 0) {
-			TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list);
-			TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list);
+	if (pc != NULL) {
+		for (field = 0; field < _NPCM; field++) {
+			bit = -1;
+			if (pc->pc_map[field])
+				bit = bsfq(pc->pc_map[field]);
+			if (bit >= 0)
+				break;
+		}
+		if (bit >= 0) {
+			pv = &pc->pc_pventry[field * 64 + bit];
+			pc->pc_map[field] &= ~(1ul << bit);
+			/* If this was the last item, move it to tail */
+			if (pc->pc_map[0] == 0 && pc->pc_map[1] == 0 &&
+			    pc->pc_map[2] == 0) {
+				TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list);
+				TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list);
+			}
+			pv_entry_spare--;
+			return (pv);
 		}
-		pv_entry_spare--;
-		return (pv);
 	}
-alloc:
 	/* No free items, allocate another chunk */
 	m = vm_page_alloc(NULL, colour, VM_ALLOC_SYSTEM | VM_ALLOC_NOOBJ);
 	if (m == NULL) {



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