aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_tun.c
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2008-06-11 18:55:19 +0000
committerEd Schouten <ed@FreeBSD.org>2008-06-11 18:55:19 +0000
commit29d4cb241b5b8d786221402075febdb832fea55a (patch)
tree08955a306d4e2b47f429af5b10f9ef048618b232 /sys/net/if_tun.c
parentb4b04f194fd2d2926b6cd55795d1d73a81526ff1 (diff)
downloadsrc-29d4cb241b5b8d786221402075febdb832fea55a.tar.gz
src-29d4cb241b5b8d786221402075febdb832fea55a.zip
Don't enforce unique device minor number policy anymore.
Except for the case where we use the cloner library (clone_create() and friends), there is no reason to enforce a unique device minor number policy. There are various drivers in the source tree that allocate unr pools and such to provide minor numbers, without using them themselves. Because we still need to support unique device minor numbers for the cloner library, introduce a new flag called D_NEEDMINOR. All cdevsw's that are used in combination with the cloner library should be marked with this flag to make the cloning work. This means drivers can now freely use si_drv0 to store their own flags and state, making it effectively the same as si_drv1 and si_drv2. We still keep the minor() and dev2unit() routines around to make drivers happy. The NTFS code also used the minor number in its hash table. We should not do this anymore. If the si_drv0 field would be changed, it would no longer end up in the same list. Approved by: philip (mentor)
Notes
Notes: svn path=/head/; revision=179726
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r--sys/net/if_tun.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index cf4a3b9dc833..6f6f05ca6da0 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -162,7 +162,7 @@ static struct filterops tun_write_filterops = {
static struct cdevsw tun_cdevsw = {
.d_version = D_VERSION,
- .d_flags = D_PSEUDO | D_NEEDGIANT,
+ .d_flags = D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR,
.d_open = tunopen,
.d_close = tunclose,
.d_read = tunread,