aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>2001-06-01 15:51:10 +0000
committerBrian Somers <brian@FreeBSD.org>2001-06-01 15:51:10 +0000
commit51716196a4ccfc27ed8c36d55ed62bdd50b080c0 (patch)
treece59d12b70bf0b4897fc0bf466f66ccc120b437c /sys/fs
parenta8634a00099f3be68410b8ca1888e1bf72305d1e (diff)
downloadsrc-51716196a4ccfc27ed8c36d55ed62bdd50b080c0.tar.gz
src-51716196a4ccfc27ed8c36d55ed62bdd50b080c0.zip
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
Notes
Notes: svn path=/head/; revision=77589
Diffstat (limited to 'sys/fs')
-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 bbc14dc58d5a..b8d5cceb4efb 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);