diff options
author | mckusick <mckusick@FreeBSD.org> | 2000-09-27 18:03:17 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2000-09-27 18:03:17 +0000 |
commit | 781d4acf4fb99c23c761ca8a97d2f0bb0b5ded59 (patch) | |
tree | 71bd0b34bb69bad87718773980465c28a3c6e7bc | |
parent | 583fe44d99558497929ebfc60d3214b42506987f (diff) | |
download | FreeBSD-src-781d4acf4fb99c23c761ca8a97d2f0bb0b5ded59.zip FreeBSD-src-781d4acf4fb99c23c761ca8a97d2f0bb0b5ded59.tar.gz |
Do the right thing if bdevvp is called twice for the same device.
Obtained from: Poul-Henning Kamp <phk@freebsd.org>
-rw-r--r-- | sys/kern/vfs_export.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 2 |
2 files changed, 4 insertions, 0 deletions
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; |