PERFORCE change 93328 for review
Peter Wemm
peter at FreeBSD.org
Wed Mar 15 00:52:07 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=93328
Change 93328 by peter at 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) {
More information about the p4-projects
mailing list