Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jul 2000 10:33:36 +0200
From:      Adrian Chadd <adrian@freebsd.org>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        arch@freebsd.org
Subject:   Re: DEVFS, the complete picture (Was: Re: SysctlFS)
Message-ID:  <20000719103336.B40749@ywing.creative.net.au>
In-Reply-To: <2732.963993497@critter.freebsd.dk>; from phk@critter.freebsd.dk on Wed, Jul 19, 2000 at 09:58:17AM %2B0200
References:  <3974D642.59E2B600@elischer.org> <2732.963993497@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

[To/CC list chomped because I think we're all on -arch anyway]

On Wed, Jul 19, 2000, Poul-Henning Kamp wrote:
> In message <3974D642.59E2B600@elischer.org>, Julian Elischer writes:
> 
> >> Your "symlink device node" proposal still doesn't solve the
> >> cloning problem, so it is only 1/2 a solution to what in
> >> practice is a non-problem.
> >
> >It allows the cloning devices to be represented
> >all over the filesystems rather than limitted to the devfs,
> >thus it allows them to be in chroot/jails without zillions
> >of devfs mounts...
> 
> No it doesn't.  You "symlink" idea just replaces the major+minor
> with a string, that's all.
> 
> Cloning can be done two ways, which I will illustrate with the pty
> driver as example:
> 
> A)	You open "/dev/pty", which clones and does some h0h0magic
> 	with vnodes and fdesc.
> 	You call ioctl(fd, WHATSMYREALNAME, buf, sizeof(buf))
> 	and it tells you that you are really "/dev/pty102".
> 
> B)	You try to open ("/dev/pty%d",N) for N [0...]
> 	Once an open succeeds you have your fd and your name.
> 	(this is what we do today)

The amount of h0h0magick needed for A from a vnode point of view
really isn't that much. In fact, if you wanted to make it less
evil you could mandate that stat.st_ino or even stat.st_dev reflects
the device minor number when you're cloning, which seems a lot neater
than the above ioctl().

(I used stat.st_ino when implementing the cloning creation file in my
inode FS FFS hack.)


2c,

adrian

-- 
Adrian Chadd			Build a man a fire, and he's warm for the
<adrian@FreeBSD.org>		rest of the evening. Set a man on fire and
				he's warm for the rest of his life.



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?20000719103336.B40749>