Add a new BUF_INIT() macro which initializes b_dep and b_interlock, and

use it.  This fixes a few places where either b_dep or b_interlock were
not properly initialized.
This commit is contained in:
thorpej 2003-02-25 20:35:31 +00:00
parent cc005c66db
commit eb14e86676
17 changed files with 60 additions and 71 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sd.c,v 1.58 2003/01/17 22:53:07 thorpej Exp $ */
/* $NetBSD: sd.c,v 1.59 2003/02/25 20:35:31 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.58 2003/01/17 22:53:07 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.59 2003/02/25 20:35:31 thorpej Exp $");
#include "rnd.h"
#include "opt_useleds.h"
@ -352,11 +352,11 @@ sdgetcapacity(sc, dev)
bp = malloc(sizeof *bp, M_DEVBUF, M_WAITOK);
sc->sc_format_pid = curproc->p_pid;
memcpy(&sc->sc_cmdstore, &cap, sizeof cap);
BUF_INIT(bp);
bp->b_dev = dev;
bp->b_flags = B_READ | B_BUSY;
bp->b_data = (caddr_t)capbuf;
bp->b_bcount = capbufsize;
LIST_INIT(&bp->b_dep);
sdstrategy(bp);
i = biowait(bp) ? sc->sc_sensestore.status : 0;
free(bp, M_DEVBUF);
@ -631,6 +631,7 @@ sdlblkstrat(bp, bsize)
M_WAITOK | M_ZERO);
cbuf = (caddr_t)malloc(bsize, M_DEVBUF, M_WAITOK);
BUF_INIT(cbp);
cbp->b_proc = curproc; /* XXX */
cbp->b_dev = bp->b_dev;
bn = bp->b_blkno;

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.103 2003/02/05 21:38:38 pk Exp $ */
/* $NetBSD: fd.c,v 1.104 2003/02/25 20:35:33 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -2115,7 +2115,7 @@ fdformat(dev, finfo, p)
return (ENOBUFS);
memset((void *)bp, 0, sizeof(struct buf));
simple_lock_init(&bp->b_interlock);
BUF_INIT(bp);
bp->b_flags = B_BUSY | B_PHYS | B_FORMAT;
bp->b_proc = p;
bp->b_dev = dev;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ata_raid.c,v 1.2 2003/02/05 21:38:40 pk Exp $ */
/* $NetBSD: ata_raid.c,v 1.3 2003/02/25 20:35:35 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -296,8 +296,7 @@ ata_raid_config_block_rw(struct vnode *vp, daddr_t blkno, void *buf,
int error;
bp = pool_get(&bufpool, PR_WAITOK);
simple_lock_init(&bp->b_interlock);
LIST_INIT(&bp->b_dep);
BUF_INIT(bp);
bp->b_vp = vp;
bp->b_dev = vp->v_rdev;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ld_ataraid.c,v 1.3 2003/01/29 16:50:37 thorpej Exp $ */
/* $NetBSD: ld_ataraid.c,v 1.4 2003/02/25 20:35:35 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -231,6 +231,7 @@ ld_ataraid_make_cbuf(struct ld_ataraid_softc *sc, struct buf *bp,
cbp = CBUF_GET();
if (cbp == NULL)
return (NULL);
BUF_INIT(&cbp->cb_buf);
cbp->cb_buf.b_flags = bp->b_flags | B_CALL;
cbp->cb_buf.b_iodone = sc->sc_iodone;
cbp->cb_buf.b_proc = bp->b_proc;
@ -238,7 +239,6 @@ ld_ataraid_make_cbuf(struct ld_ataraid_softc *sc, struct buf *bp,
cbp->cb_buf.b_dev = sc->sc_vnodes[comp]->v_rdev;
cbp->cb_buf.b_blkno = bn + sc->sc_aai->aai_offset;
cbp->cb_buf.b_data = addr;
LIST_INIT(&cbp->cb_buf.b_dep);
cbp->cb_buf.b_bcount = bcount;
/* Context for iodone */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ccd.c,v 1.82 2003/02/05 21:38:39 pk Exp $ */
/* $NetBSD: ccd.c,v 1.83 2003/02/25 20:35:33 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 1999 The NetBSD Foundation, Inc.
@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.82 2003/02/05 21:38:39 pk Exp $");
__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.83 2003/02/25 20:35:33 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -802,7 +802,7 @@ ccdbuffer(cs, bp, bn, addr, bcount)
cbp = CCD_GETBUF();
if (cbp == NULL)
return (NULL);
simple_lock_init(&cbp->cb_buf.b_interlock);
BUF_INIT(&cbp->cb_buf);
cbp->cb_buf.b_flags = bp->b_flags | B_CALL;
cbp->cb_buf.b_iodone = ccdiodone;
cbp->cb_buf.b_proc = bp->b_proc;
@ -810,7 +810,6 @@ ccdbuffer(cs, bp, bn, addr, bcount)
cbp->cb_buf.b_blkno = cbn + cboff;
cbp->cb_buf.b_data = addr;
cbp->cb_buf.b_vp = ci->ci_vp;
LIST_INIT(&cbp->cb_buf.b_dep);
if (cs->sc_ileave == 0)
cbc = dbtob((u_int64_t)(ci->ci_size - cbn));
else

View File

@ -1,4 +1,4 @@
/* $NetBSD: cgd.c,v 1.7 2003/02/05 21:38:40 pk Exp $ */
/* $NetBSD: cgd.c,v 1.8 2003/02/25 20:35:34 thorpej Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.7 2003/02/05 21:38:40 pk Exp $");
__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.8 2003/02/25 20:35:34 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -307,7 +307,7 @@ cgdstart(struct dk_softc *dksc, struct buf *bp)
disk_unbusy(&dksc->sc_dkdev, 0, (bp->b_flags & B_READ));
return;
}
simple_lock_init(&cbp->cb_buf.b_interlock);
BUF_INIT(&cbp->cb_buf);
cbp->cb_buf.b_data = newaddr;
cbp->cb_buf.b_flags = bp->b_flags | B_CALL;
cbp->cb_buf.b_iodone = cgdiodone;
@ -315,7 +315,6 @@ cgdstart(struct dk_softc *dksc, struct buf *bp)
cbp->cb_buf.b_dev = cs->sc_tdev;
cbp->cb_buf.b_blkno = bn;
cbp->cb_buf.b_vp = cs->sc_tvn;
LIST_INIT(&cbp->cb_buf.b_dep);
cbp->cb_buf.b_bcount = bp->b_bcount;
/* context for cgdiodone */

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.38 2003/02/05 22:14:01 pk Exp $ */
/* $NetBSD: fd.c,v 1.39 2003/02/25 20:35:35 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -92,7 +92,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.38 2003/02/05 22:14:01 pk Exp $");
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.39 2003/02/25 20:35:35 thorpej Exp $");
#include "rnd.h"
#include "opt_ddb.h"
@ -1491,7 +1491,7 @@ fdformat(dev, finfo, p)
return ENOBUFS;
memset((void *)bp, 0, sizeof(struct buf));
simple_lock_init(&bp->b_interlock);
BUF_INIT(bp);
bp->b_flags = B_BUSY | B_PHYS | B_FORMAT;
bp->b_proc = p;
bp->b_dev = dev;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_netbsdkintf.c,v 1.154 2003/02/05 21:38:40 pk Exp $ */
/* $NetBSD: rf_netbsdkintf.c,v 1.155 2003/02/25 20:35:36 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@ -111,7 +111,7 @@
***********************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.154 2003/02/05 21:38:40 pk Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.155 2003/02/25 20:35:36 thorpej Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@ -1840,7 +1840,7 @@ rf_DispatchKernelIO(queue, req)
bp->b_error = ENOMEM;
return (ENOMEM);
}
simple_lock_init(&raidbp->rf_buf.b_interlock);
BUF_INIT(&raidbp->rf_buf);
/*
* context for raidiodone
@ -1848,8 +1848,6 @@ rf_DispatchKernelIO(queue, req)
raidbp->rf_obp = bp;
raidbp->req = req;
LIST_INIT(&raidbp->rf_buf.b_dep);
switch (req->type) {
case RF_IO_TYPE_NOP: /* used primarily to unlock a locked queue */
/* XXX need to do something extra here.. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: cd.c,v 1.178 2003/02/05 21:38:41 pk Exp $ */
/* $NetBSD: cd.c,v 1.179 2003/02/25 20:35:37 thorpej Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.178 2003/02/05 21:38:41 pk Exp $");
__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.179 2003/02/25 20:35:37 thorpej Exp $");
#include "rnd.h"
@ -647,7 +647,7 @@ cdstrategy(bp)
}
/* Set up the IOP to the bounce buffer. */
simple_lock_init(&nbp->b_interlock);
BUF_INIT(nbp);
nbp->b_error = 0;
nbp->b_proc = bp->b_proc;
nbp->b_vp = NULLVP;
@ -656,7 +656,6 @@ cdstrategy(bp)
nbp->b_bufsize = count;
nbp->b_data = bounce;
LIST_INIT(&nbp->b_dep);
nbp->b_rawblkno = blkno;
/* We need to do a read-modify-write operation */
@ -889,6 +888,7 @@ cdbounce(bp)
}
/* Set up the IOP to the bounce buffer. */
BUF_INIT(nbp);
nbp->b_error = 0;
nbp->b_proc = bp->b_proc;
nbp->b_vp = NULLVP;
@ -897,7 +897,6 @@ cdbounce(bp)
nbp->b_bufsize = bp->b_bufsize;
nbp->b_data = bp->b_data;
LIST_INIT(&nbp->b_dep);
nbp->b_rawblkno = bp->b_rawblkno;
/* We need to do a read-modify-write operation */

View File

@ -1,4 +1,4 @@
/* $NetBSD: vnd.c,v 1.91 2003/02/05 21:38:39 pk Exp $ */
/* $NetBSD: vnd.c,v 1.92 2003/02/25 20:35:34 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -98,7 +98,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.91 2003/02/05 21:38:39 pk Exp $");
__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.92 2003/02/25 20:35:34 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "fs_nfs.h"
@ -490,7 +490,7 @@ vndstrategy(bp)
s = splbio();
nbp = VND_GETBUF(vnd);
splx(s);
simple_lock_init(&nbp->vb_buf.b_interlock);
BUF_INIT(&nbp->vb_buf);
nbp->vb_buf.b_flags = flags;
nbp->vb_buf.b_bcount = sz;
nbp->vb_buf.b_bufsize = round_page((ulong)addr + sz)
@ -501,7 +501,6 @@ vndstrategy(bp)
nbp->vb_buf.b_proc = bp->b_proc;
nbp->vb_buf.b_iodone = vndiodone;
nbp->vb_buf.b_vp = NULLVP;
LIST_INIT(&nbp->vb_buf.b_dep);
nbp->vb_xfer = vnx;

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_physio.c,v 1.55 2003/02/05 21:38:42 pk Exp $ */
/* $NetBSD: kern_physio.c,v 1.56 2003/02/25 20:35:38 thorpej Exp $ */
/*-
* Copyright (c) 1994 Christopher G. Demetriou
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_physio.c,v 1.55 2003/02/05 21:38:42 pk Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_physio.c,v 1.56 2003/02/25 20:35:38 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -275,7 +275,7 @@ getphysbuf()
bp = pool_get(&bufpool, PR_WAITOK);
splx(s);
memset(bp, 0, sizeof(*bp));
simple_lock_init(&bp->b_interlock);
BUF_INIT(bp);
return(bp);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_bio.c,v 1.90 2003/02/06 11:46:49 pk Exp $ */
/* $NetBSD: vfs_bio.c,v 1.91 2003/02/25 20:35:38 thorpej Exp $ */
/*-
* Copyright (c) 1994 Christopher G. Demetriou
@ -51,7 +51,7 @@
#include "opt_softdep.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.90 2003/02/06 11:46:49 pk Exp $");
__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.91 2003/02/25 20:35:38 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -175,10 +175,9 @@ bufinit()
for (i = 0; i < nbuf; i++) {
bp = &buf[i];
memset((char *)bp, 0, sizeof(*bp));
simple_lock_init(&bp->b_interlock);
BUF_INIT(bp);
bp->b_dev = NODEV;
bp->b_vnbufs.le_next = NOLIST;
LIST_INIT(&bp->b_dep);
bp->b_data = buffers + i * MAXBSIZE;
if (i < residual)
bp->b_bufsize = (base + 1) * PAGE_SIZE;

View File

@ -1,4 +1,4 @@
/* $NetBSD: genfs_vnops.c,v 1.72 2003/02/17 23:48:11 perseant Exp $ */
/* $NetBSD: genfs_vnops.c,v 1.73 2003/02/25 20:35:38 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.72 2003/02/17 23:48:11 perseant Exp $");
__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.73 2003/02/25 20:35:38 thorpej Exp $");
#include "opt_nfsserver.h"
@ -653,14 +653,13 @@ genfs_getpages(void *v)
s = splbio();
mbp = pool_get(&bufpool, PR_WAITOK);
splx(s);
simple_lock_init(&mbp->b_interlock);
BUF_INIT(mbp);
mbp->b_bufsize = totalbytes;
mbp->b_data = (void *)kva;
mbp->b_resid = mbp->b_bcount = bytes;
mbp->b_flags = B_BUSY|B_READ| (async ? B_CALL|B_ASYNC : 0);
mbp->b_iodone = (async ? uvm_aio_biodone : 0);
mbp->b_vp = vp;
LIST_INIT(&mbp->b_dep);
/*
* if EOF is in the middle of the range, zero the part past EOF.
@ -787,14 +786,13 @@ genfs_getpages(void *v)
s = splbio();
bp = pool_get(&bufpool, PR_WAITOK);
splx(s);
simple_lock_init(&bp->b_interlock);
BUF_INIT(bp);
bp->b_data = (char *)kva + offset - startoffset;
bp->b_resid = bp->b_bcount = iobytes;
bp->b_flags = B_BUSY|B_READ|B_CALL|B_ASYNC;
bp->b_iodone = uvm_aio_biodone1;
bp->b_vp = vp;
bp->b_proc = NULL;
LIST_INIT(&bp->b_dep);
}
bp->b_lblkno = 0;
bp->b_private = mbp;
@ -1409,7 +1407,7 @@ genfs_gop_write(struct vnode *vp, struct vm_page **pgs, int npages, int flags)
vp->v_numoutput += 2;
simple_unlock(&global_v_numoutput_slock);
mbp = pool_get(&bufpool, PR_WAITOK);
simple_lock_init(&mbp->b_interlock);
BUF_INIT(mbp);
UVMHIST_LOG(ubchist, "vp %p mbp %p num now %d bytes 0x%x",
vp, mbp, vp->v_numoutput, bytes);
splx(s);
@ -1419,7 +1417,6 @@ genfs_gop_write(struct vnode *vp, struct vm_page **pgs, int npages, int flags)
mbp->b_flags = B_BUSY|B_WRITE|B_AGE| (async ? (B_CALL|B_ASYNC) : 0);
mbp->b_iodone = uvm_aio_biodone;
mbp->b_vp = vp;
LIST_INIT(&mbp->b_dep);
bp = NULL;
for (offset = startoffset;
@ -1451,14 +1448,13 @@ genfs_gop_write(struct vnode *vp, struct vm_page **pgs, int npages, int flags)
UVMHIST_LOG(ubchist, "vp %p bp %p num now %d",
vp, bp, vp->v_numoutput, 0);
splx(s);
simple_lock_init(&bp->b_interlock);
BUF_INIT(bp);
bp->b_data = (char *)kva +
(vaddr_t)(offset - pg->offset);
bp->b_resid = bp->b_bcount = iobytes;
bp->b_flags = B_BUSY|B_WRITE|B_CALL|B_ASYNC;
bp->b_iodone = uvm_aio_biodone1;
bp->b_vp = vp;
LIST_INIT(&bp->b_dep);
}
bp->b_lblkno = 0;
bp->b_private = mbp;
@ -1658,7 +1654,7 @@ genfs_compat_gop_write(struct vnode *vp, struct vm_page **pgs, int npages,
bp = pool_get(&bufpool, PR_WAITOK);
splx(s);
simple_lock_init(&bp->b_interlock);
BUF_INIT(bp);
bp->b_flags = B_BUSY | B_WRITE | B_AGE;
bp->b_vp = vp;
bp->b_lblkno = offset >> vp->v_mount->mnt_fs_bshift;
@ -1666,7 +1662,6 @@ genfs_compat_gop_write(struct vnode *vp, struct vm_page **pgs, int npages,
bp->b_bcount = npages << PAGE_SHIFT;
bp->b_bufsize = npages << PAGE_SHIFT;
bp->b_resid = 0;
LIST_INIT(&bp->b_dep);
if (error) {
bp->b_flags |= B_ERROR;
bp->b_error = error;

View File

@ -1,4 +1,4 @@
/* $NetBSD: buf.h,v 1.57 2003/02/05 21:38:43 pk Exp $ */
/* $NetBSD: buf.h,v 1.58 2003/02/25 20:35:39 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -182,6 +182,12 @@ struct buf {
struct workhead b_dep; /* List of filesystem dependencies. */
};
#define BUF_INIT(bp) \
do { \
LIST_INIT(&(bp)->b_dep); \
simple_lock_init(&(bp)->b_interlock); \
} while (/*CONSTCOND*/0)
/*
* For portability with historic industry practice, the cylinder number has
* to be maintained in the `b_resid' field.

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_bio.c,v 1.61 2003/02/20 04:27:23 perseant Exp $ */
/* $NetBSD: lfs_bio.c,v 1.62 2003/02/25 20:35:40 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.61 2003/02/20 04:27:23 perseant Exp $");
__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.62 2003/02/25 20:35:40 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -646,7 +646,7 @@ lfs_newbuf(struct lfs *fs, struct vnode *vp, daddr_t daddr, size_t size, int typ
bp = pool_get(&bufpool, PR_WAITOK);
splx(s);
memset(bp, 0, sizeof(struct buf));
simple_lock_init(&bp->b_interlock);
BUF_INIT(bp);
if (nbytes) {
bp->b_data = lfs_malloc(fs, nbytes, type);
/* memset(bp->b_data, 0, nbytes); */
@ -657,7 +657,6 @@ lfs_newbuf(struct lfs *fs, struct vnode *vp, daddr_t daddr, size_t size, int typ
if (bp == NULL)
panic("bp is NULL after malloc in lfs_newbuf");
#endif
simple_lock_init(&bp->b_interlock);
s = splbio();
bgetvp(vp, bp);
splx(s);

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_vfsops.c,v 1.98 2003/02/25 13:47:44 yamt Exp $ */
/* $NetBSD: lfs_vfsops.c,v 1.99 2003/02/25 20:35:40 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.98 2003/02/25 13:47:44 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.99 2003/02/25 20:35:40 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@ -1875,7 +1875,7 @@ lfs_gop_write(struct vnode *vp, struct vm_page **pgs, int npages, int flags)
splx(s);
memset(mbp, 0, sizeof(*bp));
simple_lock_init(&mbp->b_interlock);
BUF_INIT(mbp);
UVMHIST_LOG(ubchist, "vp %p mbp %p num now %d bytes 0x%x",
vp, mbp, vp->v_numoutput, bytes);
mbp->b_bufsize = npages << PAGE_SHIFT;
@ -1884,7 +1884,6 @@ lfs_gop_write(struct vnode *vp, struct vm_page **pgs, int npages, int flags)
mbp->b_flags = B_BUSY|B_WRITE|B_AGE|B_CALL;
mbp->b_iodone = uvm_aio_biodone;
mbp->b_vp = vp;
LIST_INIT(&mbp->b_dep);
bp = NULL;
for (offset = startoffset;
@ -1950,13 +1949,12 @@ lfs_gop_write(struct vnode *vp, struct vm_page **pgs, int npages, int flags)
vp, bp, vp->v_numoutput, 0);
splx(s);
memset(bp, 0, sizeof(*bp));
simple_lock_init(&bp->b_interlock);
BUF_INIT(bp);
bp->b_data = (char *)kva +
(vaddr_t)(offset - pg->offset);
bp->b_resid = bp->b_bcount = iobytes;
bp->b_flags = B_BUSY|B_WRITE|B_CALL;
bp->b_iodone = uvm_aio_biodone1;
LIST_INIT(&bp->b_dep);
}
/* XXX This is silly ... is this necessary? */

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_swap.c,v 1.76 2003/02/05 21:38:46 pk Exp $ */
/* $NetBSD: uvm_swap.c,v 1.77 2003/02/25 20:35:41 thorpej Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Matthew R. Green
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.76 2003/02/05 21:38:46 pk Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.77 2003/02/25 20:35:41 thorpej Exp $");
#include "fs_nfs.h"
#include "opt_uvmhist.h"
@ -1286,7 +1286,7 @@ sw_reg_strategy(sdp, bp, bn)
* cast pointers between the two structure easily.
*/
getvndbuf(nbp);
simple_lock_init(&nbp->vb_buf.b_interlock);
BUF_INIT(&nbp->vb_buf);
nbp->vb_buf.b_flags = bp->b_flags | B_CALL;
nbp->vb_buf.b_bcount = sz;
nbp->vb_buf.b_bufsize = sz;
@ -1300,7 +1300,6 @@ sw_reg_strategy(sdp, bp, bn)
if (vp->v_type == VBLK) {
nbp->vb_buf.b_dev = vp->v_rdev;
}
LIST_INIT(&nbp->vb_buf.b_dep);
nbp->vb_xfer = vnx; /* patch it back in to vnx */
@ -1699,7 +1698,7 @@ uvm_swap_io(pps, startslot, npages, flags)
* /dev/drum's vnode [swapdev_vp].
*/
simple_lock_init(&bp->b_interlock);
BUF_INIT(bp);
bp->b_flags = B_BUSY | B_NOCACHE | (flags & (B_READ|B_ASYNC));
bp->b_proc = &proc0; /* XXX */
bp->b_vnbufs.le_next = NOLIST;
@ -1708,7 +1707,6 @@ uvm_swap_io(pps, startslot, npages, flags)
bp->b_vp = swapdev_vp;
bp->b_dev = swapdev_vp->v_rdev;
bp->b_bufsize = bp->b_bcount = npages << PAGE_SHIFT;
LIST_INIT(&bp->b_dep);
/*
* bump v_numoutput (counter of number of active outputs).