Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jun 2001 11:42:04 -0400 (EDT)
From:      Zhihui Zhang <zzhang@cs.binghamton.edu>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Confusion with mknod() and devfs
Message-ID:  <Pine.SOL.4.21.0106241124300.22184-100000@opal>
In-Reply-To: <3B350150.E6175A61@mindspring.com>

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

On Sat, 23 Jun 2001, Terry Lambert wrote:

> Zhihui Zhang wrote:
> > I think you got me wrong. I was talking about a device
> > with more than one names.  So we can have more than one
> > vnode for the same device. (If there is more than one name
> > to the same device in the same FS, they can share the vnode,
> > otherwise, they cannot.)
> 
> This is not how it works.  The specfs/devfs will return
> the same vnode.
> 
> A "special device" file type in the traditional sense is
> a major/minor/{block|character} tuple.
> 
> The entry in an FS that references this is _not_ where
> the vnode comes from, it's a hint to tell the system to
> get the vnode from a single place, instead (specfs in a
> traditional system, vfs in a less traditional system).
> 
> 
> > Specifically, I fail to understand why we reload the inode
> > in ufs_mknod():
> 
> Because when you make the node, you may have an exiting
> open reference to the same major/minor/{block|character}
> tuple, and you don't want to duplicate it in the ihash
> cache.
> 

Thanks.  But I still don't get it.  The ihash is keyed on i_dev (the
device where the filesystem is mounted on) and i_number. 

If I have two names in a filesystem refer to the same device, then their
inode number must be different.

if two names from different filesystems refer to the same device, then
their i_dev is different even if their inode number may happen to be the
same.

So I do not see how can we avoid duplicate entries in the ihash cache.

-Zhihui



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.SOL.4.21.0106241124300.22184-100000>