summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2021-12-12 09:17:18 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2021-12-12 09:17:18 +0000
commitbea4261c99fd76e2f8e5ecddc12c8e5014ba815e (patch)
tree5c6206adc704e597e6f4ab7ebf204e7df4aa7b82
parent0eff9880d39b0731cac28706daa030d13dd2b451 (diff)
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@
-rw-r--r--sys/ufs/mfs/mfs_vnops.c6
1 files changed, 3 insertions, 3 deletions
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);