From owner-freebsd-arch Wed Jul 19 1:28:22 2000 Delivered-To: freebsd-arch@freebsd.org Received: from ywing.creative.net.au (ywing.creative.net.au [203.56.168.34]) by hub.freebsd.org (Postfix) with ESMTP id D0BC837BDE4 for ; Wed, 19 Jul 2000 01:28:17 -0700 (PDT) (envelope-from adrian@ywing.creative.net.au) Received: (from adrian@localhost) by ywing.creative.net.au (8.9.3/8.9.3) id KAA43169; Wed, 19 Jul 2000 10:33:36 +0200 (CEST) (envelope-from adrian) Date: Wed, 19 Jul 2000 10:33:36 +0200 From: Adrian Chadd To: Poul-Henning Kamp Cc: arch@freebsd.org Subject: Re: DEVFS, the complete picture (Was: Re: SysctlFS) Message-ID: <20000719103336.B40749@ywing.creative.net.au> References: <3974D642.59E2B600@elischer.org> <2732.963993497@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <2732.963993497@critter.freebsd.dk>; from phk@critter.freebsd.dk on Wed, Jul 19, 2000 at 09:58:17AM +0200 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [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 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