From 9fbf91c0dd80d1245bcefbb7bb8108da58cee077 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sat, 18 Oct 2003 11:11:05 +0000 Subject: [PATCH] Initialize bp->b_offset before calling VOP_[SPEC]STRATEGY(). Remove stale comment about B_PHYS. --- sys/vm/swap_pager.c | 1 + sys/vm/vnode_pager.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 749855d77b8..c26e2eba10b 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2541,6 +2541,7 @@ swapdev_strategy(struct buf *bp, struct swdevt *sp) } bp->b_vp = vp2; splx(s); + bp->b_offset = dbtob(bp->b_blkno); VOP_STRATEGY(vp2, bp); return; } diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index e6badfe92f4..71b3ef21f48 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -478,6 +478,7 @@ vnode_pager_input_smlfs(object, m) runningbufspace += bp->b_runningbufspace; /* do the input */ + bp->b_offset = dbtob(bp->b_blkno); VOP_SPECSTRATEGY(bp->b_vp, bp); /* we definitely need to be at splvm here */ @@ -801,7 +802,6 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) /* build a minimal buffer header */ bp->b_iocmd = BIO_READ; bp->b_iodone = bdone; - /* B_PHYS is not set, but it is nice to fill this in */ KASSERT(bp->b_rcred == NOCRED, ("leaking read ucred")); KASSERT(bp->b_wcred == NOCRED, ("leaking write ucred")); bp->b_rcred = crhold(curthread->td_ucred); @@ -817,6 +817,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) cnt.v_vnodepgsin += count; /* do the input */ + bp->b_offset = dbtob(bp->b_blkno); if (dp->v_type == VCHR) VOP_SPECSTRATEGY(bp->b_vp, bp); else