From owner-freebsd-hackers Sun Nov 8 18:46:45 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA26692 for freebsd-hackers-outgoing; Sun, 8 Nov 1998 18:46:45 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA26675 for ; Sun, 8 Nov 1998 18:46:43 -0800 (PST) (envelope-from julian@whistle.com) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id SAA06497; Sun, 8 Nov 1998 18:41:19 -0800 (PST) Received: from current1.whistle.com(207.76.205.22) via SMTP by alpo.whistle.com, id smtpduz6494; Mon Nov 9 02:41:12 1998 Date: Sun, 8 Nov 1998 18:40:41 -0800 (PST) From: Julian Elischer To: zhihuizhang cc: hackers Subject: Re: option SPLIT_DEV In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG The devfs has a backing tree that is only accessible to teh kernel, and then duplicates that tree once for every mounted instance. the reason is that the mounted instances may be re-arranged (using 'mv') but the 'blueprint' (the kernel's copy) must remain untouched. the option 'SPLIT_DEV' decides if the DEVICE nodes in the MOUNT trees are separate structures or simply additional links to the nodes in the blueprint. It can do this because the nodes in the blueprint are reference counted, and theoretically an occurence of /dev/wd0 and /chroot/dev/wd0 should point to the same node and through that, to the same vnode. When SPLIT_DEV is defined, node on each layer will point to different 'node' structures, and when it is not defined, they will all point to a common node for that device. The visible side-effect is that the 'link' count of /dev/wd0 will be 2 in the minimum case when you do 'ls -l /dev/wd0' because it is linked to both the hidden (kernel) mount and the one in /dev. if you mount /chroot/dev, the link count will increase to 3. Also, if you do a chown on one, since they are linked (acress devfs filesystems) the owner of the others will change at the same time. (as will modes, modification times etc.) they will ALL point to the same vnode when open too. With SPLIT_DEVS defined each tree has a different node, so the link counts are not so strange. I hope this helps. julian On Sun, 8 Nov 1998, zhihuizhang wrote: > > I am reading devfs source code. Can anyone tell me where the option > SPLIT_DEV is defined and what does it mean? I can not find it under > either sys/conf or sys/i386/conf. > > Thanks. > > -------------------------------------------------- > | Zhihui Zhang, http://cs.binghamton.edu/~zzhang | > | Dept. of Computer Science, SUNY at Binghamton | > -------------------------------------------------- > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message