From owner-p4-projects@FreeBSD.ORG Wed Mar 15 00:52:07 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8BF2016A424; Wed, 15 Mar 2006 00:52:07 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5469116A422 for ; Wed, 15 Mar 2006 00:52:07 +0000 (UTC) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1EC2D43D48 for ; Wed, 15 Mar 2006 00:52:07 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2F0q7PY005773 for ; Wed, 15 Mar 2006 00:52:07 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2F0q6DZ005770 for perforce@freebsd.org; Wed, 15 Mar 2006 00:52:06 GMT (envelope-from peter@freebsd.org) Date: Wed, 15 Mar 2006 00:52:06 GMT Message-Id: <200603150052.k2F0q6DZ005770@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 93328 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Mar 2006 00:52:07 -0000 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) {