From b792bebeea678f9c06d3ac261f0fa969916eb223 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sun, 24 Oct 2004 20:03:41 +0000 Subject: Move the buffer method vector (buf->b_op) to the bufobj. Extend it with a strategy method. Add bufstrategy() which do the usual VOP_SPECSTRATEGY/VOP_STRATEGY song and dance. Rename ibwrite to bufwrite(). Move the two NFS buf_ops to more sensible places, add bufstrategy to them. Add inlines for bwrite() and bstrategy() which calls through buf->b_bufobj->b_ops->b_{write,strategy}(). Replace almost all VOP_STRATEGY()/VOP_SPECSTRATEGY() calls with bstrategy(). --- sys/vm/swap_pager.c | 2 +- sys/vm/vm_pager.c | 1 - sys/vm/vnode_pager.c | 10 ++-------- 3 files changed, 3 insertions(+), 10 deletions(-) (limited to 'sys/vm') diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 47eecb517ee1..367aee906f0f 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2551,7 +2551,7 @@ swapdev_strategy(struct buf *bp, struct swdevt *sp) bp->b_vp = vp2; splx(s); bp->b_iooffset = dbtob(bp->b_blkno); - VOP_STRATEGY(vp2, bp); + bstrategy(bp); return; } diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index b6fa7a6b111e..392720d40aac 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -296,7 +296,6 @@ initpbuf(struct buf *bp) bp->b_iodone = NULL; bp->b_error = 0; bp->b_magic = B_MAGIC_BIO; - bp->b_op = &buf_ops_bio; BUF_LOCK(bp, LK_EXCLUSIVE, NULL); } diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 2b174bc59b8a..30bd8c70c999 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -479,10 +479,7 @@ vnode_pager_input_smlfs(object, m) /* do the input */ bp->b_iooffset = dbtob(bp->b_blkno); - if (dp->v_type == VCHR) - VOP_SPECSTRATEGY(bp->b_vp, bp); - else - VOP_STRATEGY(bp->b_vp, bp); + bstrategy(bp); /* we definitely need to be at splvm here */ @@ -833,10 +830,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) /* do the input */ bp->b_iooffset = dbtob(bp->b_blkno); - if (dp->v_type == VCHR) - VOP_SPECSTRATEGY(bp->b_vp, bp); - else - VOP_STRATEGY(bp->b_vp, bp); + bstrategy(bp); bwait(bp, PVM, "vnread"); -- cgit v1.3