diff options
author | ed <ed@FreeBSD.org> | 2008-06-11 18:55:19 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2008-06-11 18:55:19 +0000 |
commit | 1bfc2929862ee5b2f075e0e679a8e903d61e0bce (patch) | |
tree | 08955a306d4e2b47f429af5b10f9ef048618b232 /sys/sys/conf.h | |
parent | caec8ca31895494e3aa869e4a120eb00f6fda2ea (diff) | |
download | FreeBSD-src-1bfc2929862ee5b2f075e0e679a8e903d61e0bce.zip FreeBSD-src-1bfc2929862ee5b2f075e0e679a8e903d61e0bce.tar.gz |
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)
Diffstat (limited to 'sys/sys/conf.h')
-rw-r--r-- | sys/sys/conf.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/sys/conf.h b/sys/sys/conf.h index b9ba8fd..e26b721 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -71,7 +71,7 @@ struct cdev { gid_t si_gid; mode_t si_mode; struct ucred *si_cred; /* cached clone-time credential */ - u_int si_drv0; + int si_drv0; int si_refcount; LIST_ENTRY(cdev) si_list; LIST_ENTRY(cdev) si_clone; @@ -171,6 +171,7 @@ typedef int dumper_t( #define D_MMAP_ANON 0x00100000 /* special treatment in vm_mmap.c */ #define D_PSEUDO 0x00200000 /* make_dev() can return NULL */ #define D_NEEDGIANT 0x00400000 /* driver want Giant */ +#define D_NEEDMINOR 0x00800000 /* driver uses clone_create() */ /* * Version numbers. |