Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jul 2000 23:22:09 +0200
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        mjacob@feral.com
Cc:        freebsd-arch@FreeBSD.ORG
Subject:   Re: How much do we need the all-singing, all-dancing devfs? 
Message-ID:  <14495.964560129@critter.freebsd.dk>
In-Reply-To: Your message of "Tue, 25 Jul 2000 14:13:49 PDT." <Pine.BSF.4.05.10007251407451.16927-100000@semuta.feral.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.4.05.10007251407451.16927-100000@semuta.feral.com>, Matthe
w Jacob writes:

>> >This does fit more with a real devfs tho....
>> 
>> Right, it sure does.
>> 
>> I don't know if you followed some of the recent discussions about
>> DEVFS, but one of my ideas is that cloning be implemented so that
>> if the DEVFS doesn't find the name somebody tries to namei(), it
>> will poll a list of driver functions (registered by the drivers)
>> and if any of the drivers can instatiate the requested name they
>> do so and the lookup succeeds from there.
>> 
>> Doing it that way with a devfs means that you could actually
>> open /dev/HW:BLABLA and if the cam driver recognized this as
>> it's cue to examine the SCSI serial numbers it would do so
>> and if it found one matching it would instantiate the device
>> and your open would succeed.
>> 
>> The advantage to that scheme is that we don't clutter /dev
>> with 7 different names for each disk, only the names people
>> try to open are present.
>
>Hmmmmm ... Ehrrmmmm.... Ummm.....
>
>Okay- then you'll get the same feel as the automounter gives when you do an ls
>of '/net/freefall.freebsd.org'- a bit of a hang as this occurs and requires
>any actual probing.

No, there will not be a hang.  The "ls /dev" will return only the currently
instantiated names.  Think about the PTY driver.  The ls should only
show the PTY's actually in use, not the potential 2000 ptys of the system.

In the same way, if we did it my way, all the serial numbers and all
that would not appear in the ls, until you had actually open(2)'ed
a device using that name.  Ie:

	# ls /dev/HW*
	# disklabel /dev/HW:BLABLA__2983942394 > /dev/null
	# ls /dev/HW*
	/dev/HW:BLABLA__2983942394
	#

The Delay happens for the disklabel command, which is the one which
tries to use a non-instantiated name.
	

--
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14495.964560129>