diff --git a/sys/contrib/softupdates/ffs_softdep.c b/sys/contrib/softupdates/ffs_softdep.c index 456667d6962c..4b1c4587420e 100644 --- a/sys/contrib/softupdates/ffs_softdep.c +++ b/sys/contrib/softupdates/ffs_softdep.c @@ -3648,7 +3648,7 @@ softdep_update_inodeblock(ip, bp, waitfor) gotit = getdirtybuf(&inodedep->id_buf, MNT_WAIT); FREE_LOCK(&lk); if (gotit && - (error = VOP_BWRITE(inodedep->id_buf->b_vp, inodedep->id_buf)) != 0) + (error = BUF_WRITE(inodedep->id_buf)) != 0) softdep_error("softdep_update_inodeblock: bwrite", error); if ((inodedep->id_state & DEPCOMPLETE) == 0) panic("softdep_update_inodeblock: update failed"); @@ -3776,7 +3776,7 @@ softdep_fsync(vp) error = bread(pvp, lbn, blksize(fs, VTOI(pvp), lbn), p->p_ucred, &bp); if (error == 0) - error = VOP_BWRITE(bp->b_vp, bp); + error = BUF_WRITE(bp); vput(pvp); if (error != 0) return (error); @@ -3921,7 +3921,7 @@ softdep_sync_metadata(ap) FREE_LOCK(&lk); if (waitfor == MNT_NOWAIT) { bawrite(nbp); - } else if ((error = VOP_BWRITE(nbp->b_vp, nbp)) != 0) { + } else if ((error = BUF_WRITE(nbp)) != 0) { bawrite(bp); return (error); } @@ -3938,7 +3938,7 @@ softdep_sync_metadata(ap) FREE_LOCK(&lk); if (waitfor == MNT_NOWAIT) { bawrite(nbp); - } else if ((error = VOP_BWRITE(nbp->b_vp, nbp)) != 0) { + } else if ((error = BUF_WRITE(nbp)) != 0) { bawrite(bp); return (error); } @@ -3955,7 +3955,7 @@ softdep_sync_metadata(ap) if (getdirtybuf(&nbp, MNT_WAIT) == 0) goto restart; FREE_LOCK(&lk); - if ((error = VOP_BWRITE(nbp->b_vp, nbp)) != 0) { + if ((error = BUF_WRITE(nbp)) != 0) { bawrite(bp); return (error); } @@ -4009,7 +4009,7 @@ softdep_sync_metadata(ap) FREE_LOCK(&lk); if (waitfor == MNT_NOWAIT) { bawrite(nbp); - } else if ((error = VOP_BWRITE(nbp->b_vp, nbp)) != 0) { + } else if ((error = BUF_WRITE(nbp)) != 0) { bawrite(bp); return (error); } @@ -4030,7 +4030,7 @@ softdep_sync_metadata(ap) FREE_LOCK(&lk); if (waitfor == MNT_NOWAIT) { bawrite(nbp); - } else if ((error = VOP_BWRITE(nbp->b_vp, nbp)) != 0) { + } else if ((error = BUF_WRITE(nbp)) != 0) { bawrite(bp); return (error); } @@ -4141,7 +4141,7 @@ flush_inodedep_deps(fs, ino) FREE_LOCK(&lk); if (waitfor == MNT_NOWAIT) { bawrite(bp); - } else if ((error = VOP_BWRITE(bp->b_vp, bp)) != 0) { + } else if ((error = BUF_WRITE(bp)) != 0) { ACQUIRE_LOCK(&lk); return (error); } @@ -4163,7 +4163,7 @@ flush_inodedep_deps(fs, ino) FREE_LOCK(&lk); if (waitfor == MNT_NOWAIT) { bawrite(bp); - } else if ((error = VOP_BWRITE(bp->b_vp, bp)) != 0) { + } else if ((error = BUF_WRITE(bp)) != 0) { ACQUIRE_LOCK(&lk); return (error); } @@ -4278,8 +4278,7 @@ flush_pagedep_deps(pvp, mp, diraddhdp) gotit = getdirtybuf(&inodedep->id_buf, MNT_WAIT); FREE_LOCK(&lk); if (gotit && - (error = VOP_BWRITE(inodedep->id_buf->b_vp, - inodedep->id_buf)) != 0) + (error = BUF_WRITE(inodedep->id_buf)) != 0) break; ACQUIRE_LOCK(&lk); if (dap != LIST_FIRST(diraddhdp)) @@ -4294,7 +4293,7 @@ flush_pagedep_deps(pvp, mp, diraddhdp) fsbtodb(ump->um_fs, ino_to_fsba(ump->um_fs, inum)), (int)ump->um_fs->fs_bsize, NOCRED, &bp)) != 0) break; - if ((error = VOP_BWRITE(bp->b_vp, bp)) != 0) + if ((error = BUF_WRITE(bp)) != 0) break; ACQUIRE_LOCK(&lk); /* diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c index fe45b6edc046..dcab05efa5bb 100644 --- a/sys/dev/ccd/ccd.c +++ b/sys/dev/ccd/ccd.c @@ -890,10 +890,8 @@ ccdstart(cs, bp) if (cbp[0]->cb_buf.b_iocmd == BIO_WRITE) { cbp[0]->cb_buf.b_vp->v_numoutput++; cbp[1]->cb_buf.b_vp->v_numoutput++; - VOP_STRATEGY(cbp[0]->cb_buf.b_vp, - &cbp[0]->cb_buf); - VOP_STRATEGY(cbp[1]->cb_buf.b_vp, - &cbp[1]->cb_buf); + BUF_STRATEGY(&cbp[0]->cb_buf); + BUF_STRATEGY(&cbp[1]->cb_buf); } else { int pick = cs->sc_pick; daddr_t range = cs->sc_size / 16; @@ -904,8 +902,7 @@ ccdstart(cs, bp) cs->sc_pick = pick = 1 - pick; } cs->sc_blk[pick] = bn + btodb(rcount); - VOP_STRATEGY(cbp[pick]->cb_buf.b_vp, - &cbp[pick]->cb_buf); + BUF_STRATEGY(&cbp[pick]->cb_buf); } } else { /* @@ -913,7 +910,7 @@ ccdstart(cs, bp) */ if (cbp[0]->cb_buf.b_iocmd == BIO_WRITE) cbp[0]->cb_buf.b_vp->v_numoutput++; - VOP_STRATEGY(cbp[0]->cb_buf.b_vp, &cbp[0]->cb_buf); + BUF_STRATEGY(&cbp[0]->cb_buf); } bn += btodb(rcount); addr += rcount; @@ -1210,10 +1207,7 @@ ccdiodone(ibp) if (cbp->cb_buf.b_flags & B_ERROR) { cbp->cb_mirror->cb_pflags |= CCDPF_MIRROR_DONE; - VOP_STRATEGY( - cbp->cb_mirror->cb_buf.b_vp, - &cbp->cb_mirror->cb_buf - ); + BUF_STRATEGY(&cbp->cb_mirror->cb_buf); putccdbuf(cbp); splx(s); return; diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 4048c7fa4a7d..5f29e052e364 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -2241,7 +2241,7 @@ fdformat(dev, finfo, p) /* now do the format */ bp->b_dev = dev; - BUF_STRATEGY(bp, 0); + DEV_STRATEGY(bp, 0); /* ...and wait for it to complete */ s = splbio(); diff --git a/sys/dev/vinum/vinumdaemon.c b/sys/dev/vinum/vinumdaemon.c index 3ac54d280e45..9a04a4490374 100644 --- a/sys/dev/vinum/vinumdaemon.c +++ b/sys/dev/vinum/vinumdaemon.c @@ -205,7 +205,7 @@ recover_io(struct request *rq) * * Negotiate with phk to get it fixed. */ - BUF_STRATEGY(rq->bp, 0); /* reissue the command */ + DEV_STRATEGY(rq->bp, 0); /* reissue the command */ } /* Functions called to interface with the daemon */ diff --git a/sys/dev/vinum/vinuminterrupt.c b/sys/dev/vinum/vinuminterrupt.c index 8a234621e033..e47098fc5a7c 100644 --- a/sys/dev/vinum/vinuminterrupt.c +++ b/sys/dev/vinum/vinuminterrupt.c @@ -374,7 +374,7 @@ complete_raid5_write(struct rqelement *rqe) if (debug & DEBUG_LASTREQS) logrq(loginfo_raid5_data, (union rqinfou) rqe, bp); #endif - BUF_STRATEGY(&rqe->b, 0); + DEV_STRATEGY(&rqe->b, 0); } } } @@ -412,5 +412,5 @@ complete_raid5_write(struct rqelement *rqe) if (debug & DEBUG_LASTREQS) logrq(loginfo_raid5_parity, (union rqinfou) rqe, bp); #endif - BUF_STRATEGY(&rqe->b, 0); + DEV_STRATEGY(&rqe->b, 0); } diff --git a/sys/dev/vinum/vinumio.c b/sys/dev/vinum/vinumio.c index 8913d6651782..74a3053d814a 100644 --- a/sys/dev/vinum/vinumio.c +++ b/sys/dev/vinum/vinumio.c @@ -304,7 +304,7 @@ driveio(struct drive *drive, char *buf, size_t length, off_t offset, int flag) bp->b_saveaddr = bp->b_data; bp->b_data = buf; bp->b_bcount = len; - BUF_STRATEGY(bp, 0); /* initiate the transfer */ + DEV_STRATEGY(bp, 0); /* initiate the transfer */ error = biowait(bp); bp->b_data = bp->b_saveaddr; bp->b_flags |= B_INVAL | B_AGE; @@ -764,7 +764,7 @@ write_volume_label(int volno) * * Negotiate with phk to get it fixed. */ - BUF_STRATEGY(bp, 0); + DEV_STRATEGY(bp, 0); error = biowait(bp); bp->b_flags |= B_INVAL | B_AGE; bp->b_flags &= ~B_ERROR; diff --git a/sys/dev/vinum/vinumrequest.c b/sys/dev/vinum/vinumrequest.c index 98c78921bd7d..3e86d7473efd 100644 --- a/sys/dev/vinum/vinumrequest.c +++ b/sys/dev/vinum/vinumrequest.c @@ -419,7 +419,7 @@ launch_requests(struct request *rq, int reviveok) /* fire off the request */ - BUF_STRATEGY(&rqe->b, 0); + DEV_STRATEGY(&rqe->b, 0); } } } @@ -960,7 +960,7 @@ sdio(struct buf *bp) if (debug & DEBUG_LASTREQS) logrq(loginfo_sdiol, (union rqinfou) &sbp->b, &sbp->b); #endif - BUF_STRATEGY(&sbp->b, 0); + DEV_STRATEGY(&sbp->b, 0); splx(s); } diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index f48c0c1265f8..0eb4d54ac01e 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -435,7 +435,7 @@ spec_strategy(ap) KASSERT(devsw(bp->b_dev)->d_strategy != NULL, ("No strategy on dev %s responsible for buffer %p\n", devtoname(bp->b_dev), bp)); - BUF_STRATEGY(bp, 0); + DEV_STRATEGY(bp, 0); return (0); } @@ -463,7 +463,7 @@ spec_freeblks(ap) bp->b_blkno = ap->a_addr; bp->b_offset = dbtob(ap->a_addr); bp->b_bcount = ap->a_length; - BUF_STRATEGY(bp, 0); + DEV_STRATEGY(bp, 0); return (0); } @@ -677,7 +677,7 @@ spec_getpages(ap) cnt.v_vnodepgsin += pcount; /* Do the input. */ - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); s = splbio(); diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c index fe45b6edc046..dcab05efa5bb 100644 --- a/sys/geom/geom_ccd.c +++ b/sys/geom/geom_ccd.c @@ -890,10 +890,8 @@ ccdstart(cs, bp) if (cbp[0]->cb_buf.b_iocmd == BIO_WRITE) { cbp[0]->cb_buf.b_vp->v_numoutput++; cbp[1]->cb_buf.b_vp->v_numoutput++; - VOP_STRATEGY(cbp[0]->cb_buf.b_vp, - &cbp[0]->cb_buf); - VOP_STRATEGY(cbp[1]->cb_buf.b_vp, - &cbp[1]->cb_buf); + BUF_STRATEGY(&cbp[0]->cb_buf); + BUF_STRATEGY(&cbp[1]->cb_buf); } else { int pick = cs->sc_pick; daddr_t range = cs->sc_size / 16; @@ -904,8 +902,7 @@ ccdstart(cs, bp) cs->sc_pick = pick = 1 - pick; } cs->sc_blk[pick] = bn + btodb(rcount); - VOP_STRATEGY(cbp[pick]->cb_buf.b_vp, - &cbp[pick]->cb_buf); + BUF_STRATEGY(&cbp[pick]->cb_buf); } } else { /* @@ -913,7 +910,7 @@ ccdstart(cs, bp) */ if (cbp[0]->cb_buf.b_iocmd == BIO_WRITE) cbp[0]->cb_buf.b_vp->v_numoutput++; - VOP_STRATEGY(cbp[0]->cb_buf.b_vp, &cbp[0]->cb_buf); + BUF_STRATEGY(&cbp[0]->cb_buf); } bn += btodb(rcount); addr += rcount; @@ -1210,10 +1207,7 @@ ccdiodone(ibp) if (cbp->cb_buf.b_flags & B_ERROR) { cbp->cb_mirror->cb_pflags |= CCDPF_MIRROR_DONE; - VOP_STRATEGY( - cbp->cb_mirror->cb_buf.b_vp, - &cbp->cb_mirror->cb_buf - ); + BUF_STRATEGY(&cbp->cb_mirror->cb_buf); putccdbuf(cbp); splx(s); return; diff --git a/sys/gnu/ext2fs/ext2_bmap.c b/sys/gnu/ext2fs/ext2_bmap.c index ab5ebb5d0a4b..2f2a4dc44fdc 100644 --- a/sys/gnu/ext2fs/ext2_bmap.c +++ b/sys/gnu/ext2fs/ext2_bmap.c @@ -195,7 +195,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb) bp->b_iocmd = BIO_READ; bp->b_flags &= ~(B_INVAL|B_ERROR); vfs_busy_pages(bp, 0); - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); curproc->p_stats->p_ru.ru_inblock++; /* XXX */ error = biowait(bp); if (error) { diff --git a/sys/gnu/ext2fs/ext2_lookup.c b/sys/gnu/ext2fs/ext2_lookup.c index 985dcf395fce..71c081f46628 100644 --- a/sys/gnu/ext2fs/ext2_lookup.c +++ b/sys/gnu/ext2fs/ext2_lookup.c @@ -865,7 +865,7 @@ ext2_direnter(ip, dvp, cnp) ep = (struct ext2_dir_entry_2 *)((char *)ep + dsize); } bcopy((caddr_t)&newdir, (caddr_t)ep, (u_int)newentrysize); - error = VOP_BWRITE(bp->b_vp, bp); + error = BUF_WRITE(bp); dp->i_flag |= IN_CHANGE | IN_UPDATE; if (!error && dp->i_endoff && dp->i_endoff < dp->i_size) error = UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_SYNC, @@ -904,7 +904,7 @@ ext2_dirremove(dvp, cnp) UFS_BLKATOFF(dvp, (off_t)dp->i_offset, (char **)&ep, &bp)) != 0) return (error); ep->inode = 0; - error = VOP_BWRITE(bp->b_vp, bp); + error = BUF_WRITE(bp); dp->i_flag |= IN_CHANGE | IN_UPDATE; return (error); } @@ -915,7 +915,7 @@ ext2_dirremove(dvp, cnp) (char **)&ep, &bp)) != 0) return (error); ep->rec_len += dp->i_reclen; - error = VOP_BWRITE(bp->b_vp, bp); + error = BUF_WRITE(bp); dp->i_flag |= IN_CHANGE | IN_UPDATE; return (error); } @@ -943,7 +943,7 @@ ext2_dirrewrite(dp, ip, cnp) ep->file_type = DTTOFT(IFTODT(ip->i_mode)); else ep->file_type = EXT2_FT_UNKNOWN; - error = VOP_BWRITE(bp->b_vp, bp); + error = BUF_WRITE(bp); dp->i_flag |= IN_CHANGE | IN_UPDATE; return (error); } diff --git a/sys/gnu/fs/ext2fs/ext2_bmap.c b/sys/gnu/fs/ext2fs/ext2_bmap.c index ab5ebb5d0a4b..2f2a4dc44fdc 100644 --- a/sys/gnu/fs/ext2fs/ext2_bmap.c +++ b/sys/gnu/fs/ext2fs/ext2_bmap.c @@ -195,7 +195,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb) bp->b_iocmd = BIO_READ; bp->b_flags &= ~(B_INVAL|B_ERROR); vfs_busy_pages(bp, 0); - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); curproc->p_stats->p_ru.ru_inblock++; /* XXX */ error = biowait(bp); if (error) { diff --git a/sys/gnu/fs/ext2fs/ext2_lookup.c b/sys/gnu/fs/ext2fs/ext2_lookup.c index 985dcf395fce..71c081f46628 100644 --- a/sys/gnu/fs/ext2fs/ext2_lookup.c +++ b/sys/gnu/fs/ext2fs/ext2_lookup.c @@ -865,7 +865,7 @@ ext2_direnter(ip, dvp, cnp) ep = (struct ext2_dir_entry_2 *)((char *)ep + dsize); } bcopy((caddr_t)&newdir, (caddr_t)ep, (u_int)newentrysize); - error = VOP_BWRITE(bp->b_vp, bp); + error = BUF_WRITE(bp); dp->i_flag |= IN_CHANGE | IN_UPDATE; if (!error && dp->i_endoff && dp->i_endoff < dp->i_size) error = UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_SYNC, @@ -904,7 +904,7 @@ ext2_dirremove(dvp, cnp) UFS_BLKATOFF(dvp, (off_t)dp->i_offset, (char **)&ep, &bp)) != 0) return (error); ep->inode = 0; - error = VOP_BWRITE(bp->b_vp, bp); + error = BUF_WRITE(bp); dp->i_flag |= IN_CHANGE | IN_UPDATE; return (error); } @@ -915,7 +915,7 @@ ext2_dirremove(dvp, cnp) (char **)&ep, &bp)) != 0) return (error); ep->rec_len += dp->i_reclen; - error = VOP_BWRITE(bp->b_vp, bp); + error = BUF_WRITE(bp); dp->i_flag |= IN_CHANGE | IN_UPDATE; return (error); } @@ -943,7 +943,7 @@ ext2_dirrewrite(dp, ip, cnp) ep->file_type = DTTOFT(IFTODT(ip->i_mode)); else ep->file_type = EXT2_FT_UNKNOWN; - error = VOP_BWRITE(bp->b_vp, bp); + error = BUF_WRITE(bp); dp->i_flag |= IN_CHANGE | IN_UPDATE; return (error); } diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 4048c7fa4a7d..5f29e052e364 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -2241,7 +2241,7 @@ fdformat(dev, finfo, p) /* now do the format */ bp->b_dev = dev; - BUF_STRATEGY(bp, 0); + DEV_STRATEGY(bp, 0); /* ...and wait for it to complete */ s = splbio(); diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c index 1510bf1f562e..f5b81e8bc555 100644 --- a/sys/kern/kern_physio.c +++ b/sys/kern/kern_physio.c @@ -109,7 +109,7 @@ physio(dev_t dev, struct uio *uio, int ioflag) vmapbuf(bp); } - BUF_STRATEGY(bp, 0); + DEV_STRATEGY(bp, 0); spl = splbio(); while ((bp->b_flags & B_DONE) == 0) tsleep((caddr_t)bp, PRIBIO, "physstr", 0); diff --git a/sys/kern/subr_disklabel.c b/sys/kern/subr_disklabel.c index ff72629c7d0c..20209d121f1a 100644 --- a/sys/kern/subr_disklabel.c +++ b/sys/kern/subr_disklabel.c @@ -301,7 +301,7 @@ writedisklabel(dev, lp) #ifdef __alpha__ alpha_fix_srm_checksum(bp); #endif - BUF_STRATEGY(bp, 1); + DEV_STRATEGY(bp, 1); error = biowait(bp); goto done; } diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 10b1eab35f42..3930d5491052 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -1032,7 +1032,7 @@ aio_qphysio(struct proc *p, struct aiocblist *aiocbe) splx(s); /* Perform transfer. */ - BUF_STRATEGY(bp, 0); + DEV_STRATEGY(bp, 0); s = splbio(); diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index da67cf21e708..ad38dc276f93 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -678,7 +678,7 @@ bwrite(struct buf * bp) splx(s); if (oldflags & B_ASYNC) BUF_KERNPROC(bp); - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); if ((oldflags & B_ASYNC) == 0) { int rtval = biowait(bp); @@ -886,7 +886,7 @@ void bawrite(struct buf * bp) { bp->b_flags |= B_ASYNC; - (void) VOP_BWRITE(bp->b_vp, bp); + (void) BUF_WRITE(bp); } /* @@ -901,7 +901,7 @@ int bowrite(struct buf * bp) { bp->b_flags |= B_ORDERED | B_ASYNC; - return (VOP_BWRITE(bp->b_vp, bp)); + return (BUF_WRITE(bp)); } /* @@ -1426,7 +1426,7 @@ vfs_bio_awrite(struct buf * bp) * XXX returns b_bufsize instead of b_bcount for nwritten? */ nwritten = bp->b_bufsize; - (void) VOP_BWRITE(bp->b_vp, bp); + (void) BUF_WRITE(bp); return nwritten; } @@ -2164,7 +2164,7 @@ getblk(struct vnode * vp, daddr_t blkno, int size, int slpflag, int slptimeo) (size > bp->b_kvasize)) { if (bp->b_flags & B_DELWRI) { bp->b_flags |= B_NOCACHE; - VOP_BWRITE(bp->b_vp, bp); + BUF_WRITE(bp); } else { if ((bp->b_flags & B_VMIO) && (LIST_FIRST(&bp->b_dep) == NULL)) { @@ -2172,7 +2172,7 @@ getblk(struct vnode * vp, daddr_t blkno, int size, int slpflag, int slptimeo) brelse(bp); } else { bp->b_flags |= B_NOCACHE; - VOP_BWRITE(bp->b_vp, bp); + BUF_WRITE(bp); } } goto loop; @@ -2209,7 +2209,7 @@ getblk(struct vnode * vp, daddr_t blkno, int size, int slpflag, int slptimeo) */ if ((bp->b_flags & (B_CACHE|B_DELWRI)) == B_DELWRI) { - VOP_BWRITE(bp->b_vp, bp); + BUF_WRITE(bp); goto loop; } diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index a528d8783769..273829b3b675 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -702,11 +702,11 @@ vinvalbuf(vp, flags, cred, p, slpflag, slptimeo) } else { bremfree(bp); bp->b_flags |= B_ASYNC; - VOP_BWRITE(bp->b_vp, bp); + BUF_WRITE(bp); } } else { bremfree(bp); - (void) VOP_BWRITE(bp->b_vp, bp); + (void) BUF_WRITE(bp); } break; } @@ -828,7 +828,7 @@ vtruncbuf(vp, cred, p, length, blksize) } else { bp->b_flags &= ~B_ASYNC; } - VOP_BWRITE(bp->b_vp, bp); + BUF_WRITE(bp); } goto restartsync; } diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a528d8783769..273829b3b675 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -702,11 +702,11 @@ vinvalbuf(vp, flags, cred, p, slpflag, slptimeo) } else { bremfree(bp); bp->b_flags |= B_ASYNC; - VOP_BWRITE(bp->b_vp, bp); + BUF_WRITE(bp); } } else { bremfree(bp); - (void) VOP_BWRITE(bp->b_vp, bp); + (void) BUF_WRITE(bp); } break; } @@ -828,7 +828,7 @@ vtruncbuf(vp, cred, p, length, blksize) } else { bp->b_flags &= ~B_ASYNC; } - VOP_BWRITE(bp->b_vp, bp); + BUF_WRITE(bp); } goto restartsync; } diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c index 9be35c6ffea7..e8b59ff57da9 100644 --- a/sys/miscfs/devfs/devfs_vnops.c +++ b/sys/miscfs/devfs/devfs_vnops.c @@ -1611,7 +1611,7 @@ devfs_freeblks(struct vop_freeblks_args *ap) bp->b_blkno = ap->a_addr; bp->b_offset = dbtob(ap->a_addr); bp->b_bcount = ap->a_length; - BUF_STRATEGY(bp, 0); + DEV_STRATEGY(bp, 0); return (0); } @@ -1854,7 +1854,7 @@ devfs_getpages(struct vop_getpages_args *ap) cnt.v_vnodepgsin += pcount; /* Do the input. */ - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); s = splbio(); diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index f48c0c1265f8..0eb4d54ac01e 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -435,7 +435,7 @@ spec_strategy(ap) KASSERT(devsw(bp->b_dev)->d_strategy != NULL, ("No strategy on dev %s responsible for buffer %p\n", devtoname(bp->b_dev), bp)); - BUF_STRATEGY(bp, 0); + DEV_STRATEGY(bp, 0); return (0); } @@ -463,7 +463,7 @@ spec_freeblks(ap) bp->b_blkno = ap->a_addr; bp->b_offset = dbtob(ap->a_addr); bp->b_bcount = ap->a_length; - BUF_STRATEGY(bp, 0); + DEV_STRATEGY(bp, 0); return (0); } @@ -677,7 +677,7 @@ spec_getpages(ap) cnt.v_vnodepgsin += pcount; /* Do the input. */ - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); s = splbio(); diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c index b137fe801e98..b9c3e286fc79 100644 --- a/sys/nfs/nfs_bio.c +++ b/sys/nfs/nfs_bio.c @@ -994,7 +994,7 @@ nfs_write(ap) if (bp->b_dirtyend > 0 && (on > bp->b_dirtyend || (on + n) < bp->b_dirtyoff)) { - if (VOP_BWRITE(bp->b_vp, bp) == EINTR) + if (BUF_WRITE(bp) == EINTR) return (EINTR); goto again; } @@ -1063,7 +1063,7 @@ nfs_write(ap) if ((np->n_flag & NQNFSNONCACHE) || (ioflag & IO_SYNC)) { if (ioflag & IO_INVAL) bp->b_flags |= B_NOCACHE; - error = VOP_BWRITE(bp->b_vp, bp); + error = BUF_WRITE(bp); if (error) break; if (np->n_flag & NQNFSNONCACHE) { diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index 0d286709ae18..8e38202275aa 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -3668,7 +3668,7 @@ nfsrv_commit(nfsd, slp, procp, mrq) } bremfree(bp); bp->b_flags &= ~B_ASYNC; - VOP_BWRITE(bp->b_vp, bp); + BUF_WRITE(bp); ++nfs_commit_miss; } ++nfs_commit_blks; diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 0dbbe097accd..2a36195547b6 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -2986,7 +2986,7 @@ nfs_flush(vp, cred, waitfor, p, commit) else bp->b_flags |= B_ASYNC | B_WRITEINPROG; splx(s); - VOP_BWRITE(bp->b_vp, bp); + BUF_WRITE(bp); goto loop; } splx(s); @@ -3127,7 +3127,7 @@ nfs_writebp(bp, force, procp) if (force) bp->b_flags |= B_WRITEINPROG; BUF_KERNPROC(bp); - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); if( (oldflags & B_ASYNC) == 0) { int rtval = biowait(bp); diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c index b137fe801e98..b9c3e286fc79 100644 --- a/sys/nfsclient/nfs_bio.c +++ b/sys/nfsclient/nfs_bio.c @@ -994,7 +994,7 @@ nfs_write(ap) if (bp->b_dirtyend > 0 && (on > bp->b_dirtyend || (on + n) < bp->b_dirtyoff)) { - if (VOP_BWRITE(bp->b_vp, bp) == EINTR) + if (BUF_WRITE(bp) == EINTR) return (EINTR); goto again; } @@ -1063,7 +1063,7 @@ nfs_write(ap) if ((np->n_flag & NQNFSNONCACHE) || (ioflag & IO_SYNC)) { if (ioflag & IO_INVAL) bp->b_flags |= B_NOCACHE; - error = VOP_BWRITE(bp->b_vp, bp); + error = BUF_WRITE(bp); if (error) break; if (np->n_flag & NQNFSNONCACHE) { diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 0dbbe097accd..2a36195547b6 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -2986,7 +2986,7 @@ nfs_flush(vp, cred, waitfor, p, commit) else bp->b_flags |= B_ASYNC | B_WRITEINPROG; splx(s); - VOP_BWRITE(bp->b_vp, bp); + BUF_WRITE(bp); goto loop; } splx(s); @@ -3127,7 +3127,7 @@ nfs_writebp(bp, force, procp) if (force) bp->b_flags |= B_WRITEINPROG; BUF_KERNPROC(bp); - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); if( (oldflags & B_ASYNC) == 0) { int rtval = biowait(bp); diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index 0d286709ae18..8e38202275aa 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -3668,7 +3668,7 @@ nfsrv_commit(nfsd, slp, procp, mrq) } bremfree(bp); bp->b_flags &= ~B_ASYNC; - VOP_BWRITE(bp->b_vp, bp); + BUF_WRITE(bp); ++nfs_commit_miss; } ++nfs_commit_blks; diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c index 5d76cf48ccd8..e3a6d081c388 100644 --- a/sys/pc98/cbus/fdc.c +++ b/sys/pc98/cbus/fdc.c @@ -2664,7 +2664,7 @@ fdformat(dev, finfo, p) /* now do the format */ bp->b_dev = dev; - BUF_STRATEGY(bp, 0); + DEV_STRATEGY(bp, 0); /* ...and wait for it to complete */ s = splbio(); diff --git a/sys/pc98/pc98/diskslice_machdep.c b/sys/pc98/pc98/diskslice_machdep.c index 6026e926d030..ac66299d5dc4 100644 --- a/sys/pc98/pc98/diskslice_machdep.c +++ b/sys/pc98/pc98/diskslice_machdep.c @@ -248,7 +248,7 @@ dsinit(dev, lp, sspp) if (bp->b_bcount < 1024) bp->b_bcount = 1024; #endif - BUF_STRATEGY(bp, 1); + DEV_STRATEGY(bp, 1); if (biowait(bp) != 0) { diskerr(bp, "reading primary partition table: error", LOG_PRINTF, 0, (struct disklabel *)NULL); diff --git a/sys/pc98/pc98/fd.c b/sys/pc98/pc98/fd.c index 5d76cf48ccd8..e3a6d081c388 100644 --- a/sys/pc98/pc98/fd.c +++ b/sys/pc98/pc98/fd.c @@ -2664,7 +2664,7 @@ fdformat(dev, finfo, p) /* now do the format */ bp->b_dev = dev; - BUF_STRATEGY(bp, 0); + DEV_STRATEGY(bp, 0); /* ...and wait for it to complete */ s = splbio(); diff --git a/sys/sys/bio.h b/sys/sys/bio.h index 8339978e04fe..4d672c5f2005 100644 --- a/sys/sys/bio.h +++ b/sys/sys/bio.h @@ -424,6 +424,9 @@ bufq_first(struct buf_queue_head *head) return (TAILQ_FIRST(&head->queue)); } +#define BUF_WRITE(bp) VOP_BWRITE((bp)->b_vp, (bp)) +#define BUF_STRATEGY(bp) VOP_STRATEGY((bp)->b_vp, (bp)) + #endif /* _KERNEL */ /* diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 8339978e04fe..4d672c5f2005 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -424,6 +424,9 @@ bufq_first(struct buf_queue_head *head) return (TAILQ_FIRST(&head->queue)); } +#define BUF_WRITE(bp) VOP_BWRITE((bp)->b_vp, (bp)) +#define BUF_STRATEGY(bp) VOP_STRATEGY((bp)->b_vp, (bp)) + #endif /* _KERNEL */ /* diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index f25b19fcb1fc..ffbe94fcb887 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -453,7 +453,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) panic("ffs_indirtrunc: bad buffer size"); bp->b_blkno = dbn; vfs_busy_pages(bp, 0); - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); error = biowait(bp); } if (error) { diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 456667d6962c..4b1c4587420e 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -3648,7 +3648,7 @@ softdep_update_inodeblock(ip, bp, waitfor) gotit = getdirtybuf(&inodedep->id_buf, MNT_WAIT); FREE_LOCK(&lk); if (gotit && - (error = VOP_BWRITE(inodedep->id_buf->b_vp, inodedep->id_buf)) != 0) + (error = BUF_WRITE(inodedep->id_buf)) != 0) softdep_error("softdep_update_inodeblock: bwrite", error); if ((inodedep->id_state & DEPCOMPLETE) == 0) panic("softdep_update_inodeblock: update failed"); @@ -3776,7 +3776,7 @@ softdep_fsync(vp) error = bread(pvp, lbn, blksize(fs, VTOI(pvp), lbn), p->p_ucred, &bp); if (error == 0) - error = VOP_BWRITE(bp->b_vp, bp); + error = BUF_WRITE(bp); vput(pvp); if (error != 0) return (error); @@ -3921,7 +3921,7 @@ softdep_sync_metadata(ap) FREE_LOCK(&lk); if (waitfor == MNT_NOWAIT) { bawrite(nbp); - } else if ((error = VOP_BWRITE(nbp->b_vp, nbp)) != 0) { + } else if ((error = BUF_WRITE(nbp)) != 0) { bawrite(bp); return (error); } @@ -3938,7 +3938,7 @@ softdep_sync_metadata(ap) FREE_LOCK(&lk); if (waitfor == MNT_NOWAIT) { bawrite(nbp); - } else if ((error = VOP_BWRITE(nbp->b_vp, nbp)) != 0) { + } else if ((error = BUF_WRITE(nbp)) != 0) { bawrite(bp); return (error); } @@ -3955,7 +3955,7 @@ softdep_sync_metadata(ap) if (getdirtybuf(&nbp, MNT_WAIT) == 0) goto restart; FREE_LOCK(&lk); - if ((error = VOP_BWRITE(nbp->b_vp, nbp)) != 0) { + if ((error = BUF_WRITE(nbp)) != 0) { bawrite(bp); return (error); } @@ -4009,7 +4009,7 @@ softdep_sync_metadata(ap) FREE_LOCK(&lk); if (waitfor == MNT_NOWAIT) { bawrite(nbp); - } else if ((error = VOP_BWRITE(nbp->b_vp, nbp)) != 0) { + } else if ((error = BUF_WRITE(nbp)) != 0) { bawrite(bp); return (error); } @@ -4030,7 +4030,7 @@ softdep_sync_metadata(ap) FREE_LOCK(&lk); if (waitfor == MNT_NOWAIT) { bawrite(nbp); - } else if ((error = VOP_BWRITE(nbp->b_vp, nbp)) != 0) { + } else if ((error = BUF_WRITE(nbp)) != 0) { bawrite(bp); return (error); } @@ -4141,7 +4141,7 @@ flush_inodedep_deps(fs, ino) FREE_LOCK(&lk); if (waitfor == MNT_NOWAIT) { bawrite(bp); - } else if ((error = VOP_BWRITE(bp->b_vp, bp)) != 0) { + } else if ((error = BUF_WRITE(bp)) != 0) { ACQUIRE_LOCK(&lk); return (error); } @@ -4163,7 +4163,7 @@ flush_inodedep_deps(fs, ino) FREE_LOCK(&lk); if (waitfor == MNT_NOWAIT) { bawrite(bp); - } else if ((error = VOP_BWRITE(bp->b_vp, bp)) != 0) { + } else if ((error = BUF_WRITE(bp)) != 0) { ACQUIRE_LOCK(&lk); return (error); } @@ -4278,8 +4278,7 @@ flush_pagedep_deps(pvp, mp, diraddhdp) gotit = getdirtybuf(&inodedep->id_buf, MNT_WAIT); FREE_LOCK(&lk); if (gotit && - (error = VOP_BWRITE(inodedep->id_buf->b_vp, - inodedep->id_buf)) != 0) + (error = BUF_WRITE(inodedep->id_buf)) != 0) break; ACQUIRE_LOCK(&lk); if (dap != LIST_FIRST(diraddhdp)) @@ -4294,7 +4293,7 @@ flush_pagedep_deps(pvp, mp, diraddhdp) fsbtodb(ump->um_fs, ino_to_fsba(ump->um_fs, inum)), (int)ump->um_fs->fs_bsize, NOCRED, &bp)) != 0) break; - if ((error = VOP_BWRITE(bp->b_vp, bp)) != 0) + if ((error = BUF_WRITE(bp)) != 0) break; ACQUIRE_LOCK(&lk); /* diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c index ab5ebb5d0a4b..2f2a4dc44fdc 100644 --- a/sys/ufs/ufs/ufs_bmap.c +++ b/sys/ufs/ufs/ufs_bmap.c @@ -195,7 +195,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb) bp->b_iocmd = BIO_READ; bp->b_flags &= ~(B_INVAL|B_ERROR); vfs_busy_pages(bp, 0); - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); curproc->p_stats->p_ru.ru_inblock++; /* XXX */ error = biowait(bp); if (error) { diff --git a/sys/ufs/ufs/ufs_disksubr.c b/sys/ufs/ufs/ufs_disksubr.c index ff72629c7d0c..20209d121f1a 100644 --- a/sys/ufs/ufs/ufs_disksubr.c +++ b/sys/ufs/ufs/ufs_disksubr.c @@ -301,7 +301,7 @@ writedisklabel(dev, lp) #ifdef __alpha__ alpha_fix_srm_checksum(bp); #endif - BUF_STRATEGY(bp, 1); + DEV_STRATEGY(bp, 1); error = biowait(bp); goto done; } diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 11f2ae466e28..fa2b6230ab89 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -735,7 +735,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp) bdwrite(bp); return (UFS_UPDATE(dvp, 0)); } - error = VOP_BWRITE(bp->b_vp, bp); + error = BUF_WRITE(bp); ret = UFS_UPDATE(dvp, 1); if (error == 0) return (ret); @@ -913,7 +913,7 @@ ufs_dirremove(dvp, ip, flags, isrmdir) ip->i_flag |= IN_CHANGE; } if (flags & DOWHITEOUT) - error = VOP_BWRITE(bp->b_vp, bp); + error = BUF_WRITE(bp); else if (DOINGASYNC(dvp) && dp->i_count != 0) { bdwrite(bp); error = 0; diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index c3f60181b076..53feec1d9a0f 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1422,7 +1422,7 @@ ufs_mkdir(ap) } if ((error = UFS_UPDATE(tvp, !(DOINGSOFTDEP(tvp) | DOINGASYNC(tvp)))) != 0) { - (void)VOP_BWRITE(bp->b_vp, bp); + (void)BUF_WRITE(bp); goto bad; } VN_POLLEVENT(dvp, POLLWRITE); /* XXX right place? */ @@ -1439,7 +1439,7 @@ ufs_mkdir(ap) */ if (DOINGASYNC(dvp)) bdwrite(bp); - else if (!DOINGSOFTDEP(dvp) && ((error = VOP_BWRITE(bp->b_vp, bp)))) + else if (!DOINGSOFTDEP(dvp) && ((error = BUF_WRITE(bp)))) goto bad; ufs_makedirentry(ip, cnp, &newdir); error = ufs_direnter(dvp, tvp, &newdir, cnp, bp); diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 76535060ff2c..2b00c5b60c3f 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1133,7 +1133,7 @@ swap_pager_getpages(object, m, count, reqpage) */ BUF_KERNPROC(bp); - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); /* * wait for the page we want to complete. PG_SWAPINPROG is always @@ -1383,7 +1383,7 @@ swap_pager_putpages(object, m, count, sync, rtvals) if (sync == FALSE) { bp->b_iodone = swp_pager_async_iodone; BUF_KERNPROC(bp); - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); for (j = 0; j < n; ++j) rtvals[i+j] = VM_PAGER_PEND; @@ -1397,7 +1397,7 @@ swap_pager_putpages(object, m, count, sync, rtvals) */ bp->b_iodone = swp_pager_sync_iodone; - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); /* * Wait for the sync I/O to complete, then update rtvals. diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index e3817c54ab10..6ca7f12d7cdb 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -567,7 +567,7 @@ flushchainbuf(struct buf *nbp) if (nbp->b_iocmd == BIO_WRITE) nbp->b_dirtyend = nbp->b_bcount; BUF_KERNPROC(nbp); - VOP_STRATEGY(nbp->b_vp, nbp); + BUF_STRATEGY(nbp); } else { biodone(nbp); } diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index 11ca203f8178..5b2b51424133 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -150,7 +150,7 @@ swapdev_strategy(ap) } pbreassignbuf(bp, sp->sw_vp); splx(s); - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); return 0; } diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 279f47cf4234..628d598f5ac3 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -425,7 +425,7 @@ vnode_pager_input_smlfs(object, m) bp->b_bufsize = bsize; /* do the input */ - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); /* we definitely need to be at splvm here */ @@ -746,7 +746,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) cnt.v_vnodepgsin += count; /* do the input */ - VOP_STRATEGY(bp->b_vp, bp); + BUF_STRATEGY(bp); s = splvm(); /* we definitely need to be at splvm here */