summaryrefslogtreecommitdiffstats
path: root/sys/fs/devfs/devfs_vnops.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-06-01 15:51:10 +0000
committerbrian <brian@FreeBSD.org>2001-06-01 15:51:10 +0000
commit18d829816a2677997213825136db215b5be7a1a1 (patch)
tree466c3b3f2d7f7a36065d5d8fe16c67d474765e67 /sys/fs/devfs/devfs_vnops.c
parente1e34d59e0508cd55b20f59a9671fadd3f070092 (diff)
downloadFreeBSD-src-18d829816a2677997213825136db215b5be7a1a1.zip
FreeBSD-src-18d829816a2677997213825136db215b5be7a1a1.tar.gz
Support /dev/tun cloning. Ansify if_tun.c while I'm there.
Only tun0 -> tun32767 may now be opened as struct ifnet's if_unit is a short. It's now possible to open /dev/tun and get a handle back for an available tun device (use devname to find out what you got). The implementation uses rman by popular demand (and against my judgement) to track opened devices and uses the new dev_depends() to ensure that all make_dev()d devices go away before the module is unloaded. Reviewed by: phk
Diffstat (limited to 'sys/fs/devfs/devfs_vnops.c')
-rw-r--r--sys/fs/devfs/devfs_vnops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index bbc14dc..b8d5cce 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -572,7 +572,8 @@ devfs_reclaim(ap)
vp->v_data = NULL;
if (vp->v_rdev != NODEV && vp->v_rdev != NULL) {
i = vcount(vp);
- if ((vp->v_rdev->si_flags & SI_CHEAPCLONE) && i == 0)
+ if ((vp->v_rdev->si_flags & SI_CHEAPCLONE) && i == 0 &&
+ (vp->v_rdev->si_flags & SI_NAMED))
destroy_dev(vp->v_rdev);
}
return (0);
OpenPOWER on IntegriCloud