diff options
author | phk <phk@FreeBSD.org> | 2004-10-21 15:53:54 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-10-21 15:53:54 +0000 |
commit | 3833976d1250bf118a46939f409012d87e558de6 (patch) | |
tree | 9d355bca75100170618443d740a1312fd842af5d /sys/vm | |
parent | fdf614c0bad1564664cac5105be08477d1bcdd72 (diff) | |
download | FreeBSD-src-3833976d1250bf118a46939f409012d87e558de6.zip FreeBSD-src-3833976d1250bf118a46939f409012d87e558de6.tar.gz |
Move the VI_BWAIT flag into no bo_flag element of bufobj and call it BO_WWAIT
Add bufobj_wref(), bufobj_wdrop() and bufobj_wwait() to handle the write
count on a bufobj. Bufobj_wdrop() replaces vwakeup().
Use these functions all relevant places except in ffs_softdep.c where
the use if interlocked_sleep() makes this impossible.
Rename b_vnbufs to b_bobufs now that we touch all the relevant files anyway.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/swap_pager.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 4199289..22487dd 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2545,18 +2545,9 @@ swapdev_strategy(struct buf *bp, struct swdevt *sp) s = splvm(); if (bp->b_iocmd == BIO_WRITE) { vp = bp->b_vp; - if (vp) { - VI_LOCK(vp); - vp->v_numoutput--; - if ((vp->v_iflag & VI_BWAIT) && vp->v_numoutput <= 0) { - vp->v_iflag &= ~VI_BWAIT; - wakeup(&vp->v_numoutput); - } - VI_UNLOCK(vp); - } - VI_LOCK(vp2); - vp2->v_numoutput++; - VI_UNLOCK(vp2); + if (vp) + bufobj_wdrop(&vp->v_bufobj); + bufobj_wref(&vp2->v_bufobj); } bp->b_vp = vp2; splx(s); |