From 652fcae07c44b6da13bb9c2b9ad86919c51b411d Mon Sep 17 00:00:00 2001 From: Stephen McKay Date: Mon, 5 Jul 1999 12:50:54 +0000 Subject: [PATCH] Reformat previous fix to remove an uglier than average goto. Looked OK to: dg --- sys/vm/vm_pager.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index 1895d4fedac7..f4639e5b3421 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_pager.c,v 1.49 1999/06/27 11:44:22 peter Exp $ + * $Id: vm_pager.c,v 1.50 1999/07/04 00:25:38 mckusick Exp $ */ /* @@ -377,18 +377,20 @@ getpbuf(pfreecnt) s = splvm(); -retry: - if (pfreecnt) { - while (*pfreecnt == 0) { - tsleep(pfreecnt, PVM, "wswbuf0", 0); + for (;;) { + if (pfreecnt) { + while (*pfreecnt == 0) { + tsleep(pfreecnt, PVM, "wswbuf0", 0); + } } - } - /* get a bp from the swap buffer header pool */ - while ((bp = TAILQ_FIRST(&bswlist)) == NULL) { + /* get a bp from the swap buffer header pool */ + if ((bp = TAILQ_FIRST(&bswlist)) != NULL) + break; + bswneeded = 1; tsleep(&bswneeded, PVM, "wswbuf1", 0); - goto retry; /* loop in case someone else grabbed one */ + /* loop in case someone else grabbed one */ } TAILQ_REMOVE(&bswlist, bp, b_freelist); if (pfreecnt)