Simplifying devfs: minor == unit

Ed Schouten ed at 80386.nl
Tue May 27 19:34:04 UTC 2008


* 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?

Thanks for your feedback!

-- 
 Ed Schouten <ed at 80386.nl>
 WWW: http://80386.nl/
-------------- 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/b8211a9d/attachment.pgp


More information about the freebsd-arch mailing list