Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Nov 1998 18:40:41 -0800 (PST)
From:      Julian Elischer <julian@whistle.com>
To:        zhihuizhang <bf20761@binghamton.edu>
Cc:        hackers <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: option SPLIT_DEV
Message-ID:  <Pine.BSF.3.95.981108183019.12492F-100000@current1.whistle.com>
In-Reply-To: <Pine.SOL.L3.93.981108212500.636A-100000@bingsun2>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.981108183019.12492F-100000>