From 781d4acf4fb99c23c761ca8a97d2f0bb0b5ded59 Mon Sep 17 00:00:00 2001 From: mckusick Date: Wed, 27 Sep 2000 18:03:17 +0000 Subject: Do the right thing if bdevvp is called twice for the same device. Obtained from: Poul-Henning Kamp --- sys/kern/vfs_export.c | 2 ++ sys/kern/vfs_subr.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'sys/kern') diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 6d60d44..8beb3e6 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -1319,6 +1319,8 @@ bdevvp(dev, vpp) *vpp = NULLVP; return (ENXIO); } + if (vfinddev(dev, VCHR, vpp)) + return (0); error = getnewvnode(VT_NON, (struct mount *)0, spec_vnodeop_p, &nvp); if (error) { *vpp = NULLVP; diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 6d60d44..8beb3e6 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1319,6 +1319,8 @@ bdevvp(dev, vpp) *vpp = NULLVP; return (ENXIO); } + if (vfinddev(dev, VCHR, vpp)) + return (0); error = getnewvnode(VT_NON, (struct mount *)0, spec_vnodeop_p, &nvp); if (error) { *vpp = NULLVP; -- cgit v1.1