Do the right thing if bdevvp is called twice for the same device.

Obtained from:	Poul-Henning Kamp <phk@freebsd.org>
This commit is contained in:
Kirk McKusick 2000-09-27 18:03:17 +00:00
parent 55124436ab
commit 02a1e48f02
2 changed files with 4 additions and 0 deletions

View File

@ -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;

View File

@ -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;