From: visa Date: Sun, 12 Dec 2021 09:17:17 +0000 (+0000) Subject: Use vnode parameter instead of vfinddev() in mfs_strategy() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1339c4137975fb357e0724536cba68df5e73b51e;p=openbsd Use vnode parameter instead of vfinddev() in mfs_strategy() Getting the mfs device vnode through vfinddev() is more complex than necessary. Also, the indirection is not robust. OK mpi@ --- diff --git a/sys/ufs/mfs/mfs_vnops.c b/sys/ufs/mfs/mfs_vnops.c index eba90ab9131..4b42f81a040 100644 --- a/sys/ufs/mfs/mfs_vnops.c +++ b/sys/ufs/mfs/mfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfs_vnops.c,v 1.58 2021/10/15 06:30:06 semarie Exp $ */ +/* $OpenBSD: mfs_vnops.c,v 1.59 2021/12/12 09:17:17 visa Exp $ */ /* $NetBSD: mfs_vnops.c,v 1.8 1996/03/17 02:16:32 christos Exp $ */ /* @@ -124,9 +124,9 @@ mfs_strategy(void *v) struct vop_strategy_args *ap = v; struct buf *bp = ap->a_bp; struct mfsnode *mfsp; - struct vnode *vp; + struct vnode *vp = ap->a_vp; - if (!vfinddev(bp->b_dev, VBLK, &vp) || vp->v_usecount == 0) + if (vp->v_type != VBLK || vp->v_usecount == 0) panic("mfs_strategy: bad dev"); mfsp = VTOMFS(vp);