Simplifying devfs: minor == unit

Kostik Belousov kostikbel at gmail.com
Tue May 27 19:48:43 UTC 2008


On Tue, May 27, 2008 at 09:32:42PM +0200, Ed Schouten wrote:
> * Kostik Belousov <kostikbel at gmail.com> wrote:
> > On Tue, May 27, 2008 at 06:57:53PM +0200, Ed Schouten wrote:
> > > 
> > > Please take a look at src/usr.sbin/watch/watch.c:open_snp(). We might as
> > > well turn snp(4) into a single /dev/snp, where the kernel space driver
> > > uses per-descriptor data to distinguish the instances. This provides
> > > some advantages:
> > > 
> > > - No more silly open()-loops.
> > > 
> > > - A system administrator can change the permissions on /dev/snp, which
> > >   automatically sets a system wide policy, instead on one of the device
> > >   nodes.
> > > 
> > > - We don't fill up the system with a lot of unused nodes.
> > > 
> > > 	for i in `seq 1000`
> > > 	do
> > > 		ls /dev/bpf$i > /dev/null
> > > 	done
> > Please, do not overuse the cdevpriv data (I am not speaking about snp/watch
> > ATM, each case requires careful decision). Using cdevpriv disables some
> > features that may be provided by the clones, i.e. actual cdevs. For example,
> > you cannot have several independent opens operate on the same instance.
> 
> I'll take a closer look at how it works when time permits.
> 
> Do you mind if I commit the minor == unit patch one of these days/weeks?
> 

In fact, I do not understand why you leave the UMINORMASK stuff. It makes
no sense with the unit == minor, IMHO.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20080527/d4aca86a/attachment.pgp


More information about the freebsd-arch mailing list