(void) buf_cleanout(&vbp->vb_buf);
if (vbp->vb_buf.b_vp != NULL) { brelvp(&vbp->vb_buf); }
sw_reg_iodone(bp)	struct buf *bp;{	struct vndbuf *vbp = (struct vndbuf *) bp;	struct vndxfer *vnx = vbp->vb_xfer;	struct buf *pbp = vnx->vx_bp;		/* parent buffer */	struct swapdev	*sdp = vnx->vx_sdp;	int		s, resid;	UVMHIST_FUNC("sw_reg_iodone"); UVMHIST_CALLED(pdhist);	UVMHIST_LOG(pdhist, "  vbp=%p vp=%p blkno=%x addr=%p",	    vbp, vbp->vb_buf.b_vp, vbp->vb_buf.b_blkno, vbp->vb_buf.b_data);	UVMHIST_LOG(pdhist, "  cnt=%lx resid=%lx",	    vbp->vb_buf.b_bcount, vbp->vb_buf.b_resid, 0, 0);	/*	 * protect vbp at splbio and update.	 */	s = splbio();	resid = vbp->vb_buf.b_bcount - vbp->vb_buf.b_resid;	pbp->b_resid -= resid;	vnx->vx_pending--;	if (vbp->vb_buf.b_error) {		UVMHIST_LOG(pdhist, "  got error=%d !",		    vbp->vb_buf.b_error, 0, 0, 0);		/* pass error upward */		vnx->vx_error = vbp->vb_buf.b_error;	}	/*	 * disassociate this buffer from the vnode (if any).	 */	(void) buf_cleanout(&vbp->vb_buf);	/*	 * kill vbp structure	 */	putvndbuf(vbp);	/*	 * wrap up this transaction if it has run to completion or, in	 * case of an error, when all auxiliary buffers have returned.	 */	if (vnx->vx_error != 0) {		/* pass error upward */		pbp->b_flags |= B_ERROR;		pbp->b_error = vnx->vx_error;		if ((vnx->vx_flags & VX_BUSY) == 0 && vnx->vx_pending == 0) {			putvndxfer(vnx);			biodone(pbp);		}	} else if (pbp->b_resid == 0) {		KASSERT(vnx->vx_pending == 0);		if ((vnx->vx_flags & VX_BUSY) == 0) {			UVMHIST_LOG(pdhist, "  iodone error=%d !",			    pbp, vnx->vx_error, 0, 0);			putvndxfer(vnx);			biodone(pbp);		}	}	/*	 * done!   start next swapdev I/O if one is pending	 */	sdp->swd_tab.b_active--;	sw_reg_start(sdp);	splx(s);}