Date: Sun, 07 Oct 2001 15:17:05 -0700 From: Peter Wemm <peter@wemm.org> To: Poul-Henning Kamp <phk@critter.freebsd.dk> Cc: Brian Somers <brian@Awfulhak.org>, freebsd-arch@FreeBSD.ORG Subject: Re: Cloned open support Message-ID: <20011007221706.1ABAE3809@overcee.netplex.com.au> In-Reply-To: <1359.1002473810@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
Poul-Henning Kamp wrote:
>
> Uhm, Brian...
>
> We have cloned devices already...
>
> What exactly is it that you want to implement ?
>
> Poul-Henning
Devfs name cloning feels hackish to me. Having a seperate EVENTHANDLER()
for doing it feels .. just nasty. I'd much rather that we had a d_clone
devsw entry and/or a D_CLONE d_flags entry.
There are two types of cloning. One is to map some name "/dev/fd0135ds18h"
into a device node without having to flood /dev with all possible
permutations. The other is to support per-device "select next unit" style
opens. Presently these are both kludged into the EVENTHANDLER interface.
I think Brian wants to move the second part directly into the open handler
like it is done on most other OS's that support cloning. Personally,
I would be quite happy if we could do that.
I realize why it is done the way it is done now though. VOP_LOOKUP()
having to return a unique vnode for the device is a pain. (which is why
the clone is done during lookup, so that the correct vnode is found and
available). But understanding why doesn't mean that I dont wish that it
could be different. :-)
Doug mentions the hack in dev/streams/streams.c:
td->td_dupfd = fd;
return ENXIO;
.. this is nasty. :-)
I think the SVR4 clone driver uses something like this. It causes the
original namei / open attempt to fail (thus releasing the "common" vnode)
and then switching over to the *real* file/vnode at the last minute.
Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5
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?20011007221706.1ABAE3809>
