Eliminate unnecessary KASSERTs.
Don't use bp->b_vp in VOP_STRATEGY: the vnode is passed in as an argument.
This commit is contained in:
parent
5b285effb0
commit
d83b7498a4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136991
@ -714,11 +714,9 @@ cd9660_strategy(ap)
|
||||
} */ *ap;
|
||||
{
|
||||
struct buf *bp = ap->a_bp;
|
||||
struct vnode *vp = bp->b_vp;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct iso_node *ip;
|
||||
|
||||
KASSERT(ap->a_vp == ap->a_bp->b_vp, ("%s(%p != %p)",
|
||||
__func__, ap->a_vp, ap->a_bp->b_vp));
|
||||
ip = VTOI(vp);
|
||||
if (vp->v_type == VBLK || vp->v_type == VCHR)
|
||||
panic("cd9660_strategy: spec");
|
||||
|
@ -650,8 +650,6 @@ hpfs_strategy(ap)
|
||||
daddr_t blkno;
|
||||
int error;
|
||||
|
||||
KASSERT(ap->a_vp == ap->a_bp->b_vp, ("%s(%p != %p)",
|
||||
__func__, ap->a_vp, ap->a_bp->b_vp));
|
||||
dprintf(("hpfs_strategy(): \n"));
|
||||
|
||||
if (vp->v_type == VBLK || vp->v_type == VCHR)
|
||||
|
@ -1772,15 +1772,11 @@ msdosfs_strategy(ap)
|
||||
} */ *ap;
|
||||
{
|
||||
struct buf *bp = ap->a_bp;
|
||||
struct denode *dep = VTODE(bp->b_vp);
|
||||
struct vnode *vp;
|
||||
struct denode *dep = VTODE(ap->a_vp);
|
||||
int error = 0;
|
||||
daddr_t blkno;
|
||||
|
||||
KASSERT(ap->a_vp == ap->a_bp->b_vp, ("%s(%p != %p)",
|
||||
__func__, ap->a_vp, ap->a_bp->b_vp));
|
||||
if (bp->b_vp->v_type == VBLK || bp->b_vp->v_type == VCHR)
|
||||
panic("msdosfs_strategy: spec");
|
||||
/*
|
||||
* If we don't already know the filesystem relative block number
|
||||
* then get it using pcbmap(). If pcbmap() returns the block
|
||||
|
@ -270,14 +270,12 @@ ntfs_strategy(ap)
|
||||
} */ *ap;
|
||||
{
|
||||
register struct buf *bp = ap->a_bp;
|
||||
register struct vnode *vp = bp->b_vp;
|
||||
register struct vnode *vp = ap->a_vp;
|
||||
register struct fnode *fp = VTOF(vp);
|
||||
register struct ntnode *ip = FTONT(fp);
|
||||
struct ntfsmount *ntmp = ip->i_mp;
|
||||
int error;
|
||||
|
||||
KASSERT(ap->a_vp == ap->a_bp->b_vp, ("%s(%p != %p)",
|
||||
__func__, ap->a_vp, ap->a_bp->b_vp));
|
||||
dprintf(("ntfs_strategy: offset: %d, blkno: %d, lblkno: %d\n",
|
||||
(u_int32_t)bp->b_offset,(u_int32_t)bp->b_blkno,
|
||||
(u_int32_t)bp->b_lblkno));
|
||||
|
@ -831,7 +831,7 @@ udf_strategy(struct vop_strategy_args *a)
|
||||
int maxsize;
|
||||
|
||||
bp = a->a_bp;
|
||||
vp = bp->b_vp;
|
||||
vp = a->a_vp;
|
||||
node = VTON(vp);
|
||||
|
||||
KASSERT(a->a_vp == a->a_bp->b_vp, ("%s(%p != %p)",
|
||||
|
@ -1842,15 +1842,13 @@ union_strategy(ap)
|
||||
} */ *ap;
|
||||
{
|
||||
struct buf *bp = ap->a_bp;
|
||||
struct vnode *othervp = OTHERVP(bp->b_vp);
|
||||
struct vnode *othervp = OTHERVP(ap->a_vp);
|
||||
|
||||
KASSERT(ap->a_vp == ap->a_bp->b_vp, ("%s(%p != %p)",
|
||||
__func__, ap->a_vp, ap->a_bp->b_vp));
|
||||
#ifdef DIAGNOSTIC
|
||||
if (othervp == NULLVP)
|
||||
panic("union_strategy: nil vp");
|
||||
if ((bp->b_iocmd == BIO_WRITE) &&
|
||||
(othervp == LOWERVP(bp->b_vp)))
|
||||
(othervp == LOWERVP(ap->a_vp)))
|
||||
panic("union_strategy: writing to lowervp");
|
||||
#endif
|
||||
return (VOP_STRATEGY(othervp, bp));
|
||||
|
@ -103,8 +103,7 @@ ext2_checkoverlap(bp, ip)
|
||||
start = bp->b_blkno;
|
||||
last = start + btodb(bp->b_bcount) - 1;
|
||||
for (ep = buf; ep < ebp; ep++) {
|
||||
if (ep == bp || (ep->b_flags & B_INVAL) ||
|
||||
ep->b_vp == NULLVP)
|
||||
if (ep == bp || (ep->b_flags & B_INVAL))
|
||||
continue;
|
||||
vp = ip->i_devvp;
|
||||
/* look for overlap */
|
||||
|
@ -1424,8 +1424,6 @@ ext2_strategy(ap)
|
||||
int32_t blkno;
|
||||
int error;
|
||||
|
||||
KASSERT(ap->a_vp == ap->a_bp->b_vp, ("%s(%p != %p)",
|
||||
__func__, ap->a_vp, ap->a_bp->b_vp));
|
||||
ip = VTOI(vp);
|
||||
if (vp->v_type == VBLK || vp->v_type == VCHR)
|
||||
panic("ext2_strategy: spec");
|
||||
|
@ -103,8 +103,7 @@ ext2_checkoverlap(bp, ip)
|
||||
start = bp->b_blkno;
|
||||
last = start + btodb(bp->b_bcount) - 1;
|
||||
for (ep = buf; ep < ebp; ep++) {
|
||||
if (ep == bp || (ep->b_flags & B_INVAL) ||
|
||||
ep->b_vp == NULLVP)
|
||||
if (ep == bp || (ep->b_flags & B_INVAL))
|
||||
continue;
|
||||
vp = ip->i_devvp;
|
||||
/* look for overlap */
|
||||
|
@ -1424,8 +1424,6 @@ ext2_strategy(ap)
|
||||
int32_t blkno;
|
||||
int error;
|
||||
|
||||
KASSERT(ap->a_vp == ap->a_bp->b_vp, ("%s(%p != %p)",
|
||||
__func__, ap->a_vp, ap->a_bp->b_vp));
|
||||
ip = VTOI(vp);
|
||||
if (vp->v_type == VBLK || vp->v_type == VCHR)
|
||||
panic("ext2_strategy: spec");
|
||||
|
@ -714,11 +714,9 @@ cd9660_strategy(ap)
|
||||
} */ *ap;
|
||||
{
|
||||
struct buf *bp = ap->a_bp;
|
||||
struct vnode *vp = bp->b_vp;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct iso_node *ip;
|
||||
|
||||
KASSERT(ap->a_vp == ap->a_bp->b_vp, ("%s(%p != %p)",
|
||||
__func__, ap->a_vp, ap->a_bp->b_vp));
|
||||
ip = VTOI(vp);
|
||||
if (vp->v_type == VBLK || vp->v_type == VCHR)
|
||||
panic("cd9660_strategy: spec");
|
||||
|
Loading…
Reference in New Issue
Block a user