From d4a6f93147287dd235bac94086d51025666e779b Mon Sep 17 00:00:00 2001 From: pk Date: Mon, 1 Dec 1997 16:33:15 +0000 Subject: [PATCH] Make sure the damned buffer heads are initialized... --- sys/vm/vm_swap.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index a9d75ee153f4..22e1d6e125bc 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm_swap.c,v 1.49 1997/11/29 00:35:43 pk Exp $ */ +/* $NetBSD: vm_swap.c,v 1.50 1997/12/01 16:33:15 pk Exp $ */ /* * Copyright (c) 1995, 1996, 1997 Matthew R. Green @@ -547,7 +547,8 @@ sys_swapctl(p, v, retval) sdp = (struct swapdev *) malloc(sizeof *sdp, M_VMSWAP, M_WAITOK); - sdp->swd_inuse = sdp->swd_flags = 0; + bzero(sdp, sizeof(*sdp)); + sdp->swd_vp = vp; sdp->swd_dev = (vp->v_type == VBLK) ? vp->v_rdev : NODEV; @@ -1257,22 +1258,27 @@ sw_reg_iodone(bp) pbp->b_flags |= B_ERROR; pbp->b_error = vnx->vx_error; if ((vnx->vx_flags & VX_BUSY) == 0 && vnx->vx_pending == 0) { +#ifdef SWAPDEBUG + if (vmswapdebug & VMSDB_SWFLOW) + printf("swiodone: pbp %p iodone: error %d\n", + pbp, vnx->vx_error); +#endif putvndxfer(vnx); biodone(pbp); } - } - - if (pbp->b_resid == 0) { + } else if (pbp->b_resid == 0) { +#ifdef DIAGNOSTIC if (vnx->vx_pending != 0) panic("swiodone: vnx pending: %d", vnx->vx_pending); +#endif if ((vnx->vx_flags & VX_BUSY) == 0) { - putvndxfer(vnx); #ifdef SWAPDEBUG if (vmswapdebug & VMSDB_SWFLOW) printf("swiodone: pbp %p iodone\n", pbp); #endif + putvndxfer(vnx); biodone(pbp); } }