summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-10-27 06:45:52 +0000
committerphk <phk@FreeBSD.org>2004-10-27 06:45:52 +0000
commit9d1a8435a991c28fd795ae6b2eca2391b4f8fcb3 (patch)
treef946e22fb8b296510b1ecaf265c414d73187a46d
parenta75ad583267f8d5cbe385f5734782169895e33c0 (diff)
downloadFreeBSD-src-9d1a8435a991c28fd795ae6b2eca2391b4f8fcb3.zip
FreeBSD-src-9d1a8435a991c28fd795ae6b2eca2391b4f8fcb3.tar.gz
Avoid using bp->b_vp when we already have the vnode by other means.
-rw-r--r--sys/kern/vfs_cluster.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index c5f2951..f866925 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -395,15 +395,15 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp)
* VMIO backed. The clustering code can only deal
* with VMIO-backed buffers.
*/
- VI_LOCK(bp->b_vp);
+ VI_LOCK(vp);
if ((tbp->b_vflags & BV_BKGRDINPROG) ||
(tbp->b_flags & B_CACHE) ||
(tbp->b_flags & B_VMIO) == 0) {
- VI_UNLOCK(bp->b_vp);
+ VI_UNLOCK(vp);
bqrelse(tbp);
break;
}
- VI_UNLOCK(bp->b_vp);
+ VI_UNLOCK(vp);
/*
* The buffer must be completely invalid in order to
@@ -1010,13 +1010,12 @@ cluster_collectbufs(vp, last_bp)
(void) bread(vp, lbn, last_bp->b_bcount, NOCRED, &bp);
buflist->bs_children[i] = bp;
if (bp->b_blkno == bp->b_lblkno)
- VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno,
+ VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno,
NULL, NULL);
}
buflist->bs_children[i] = bp = last_bp;
if (bp->b_blkno == bp->b_lblkno)
- VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno,
- NULL, NULL);
+ VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno, NULL, NULL);
buflist->bs_nchildren = i + 1;
return (buflist);
}
OpenPOWER on IntegriCloud