RE: PUBLIC CHALLENGE: (was RE: devfs again, (was RE: USB device a

Alexander Viro (viro@math.psu.edu)
Fri, 8 Oct 1999 13:41:03 -0400 (EDT)


On Fri, 8 Oct 1999, Shawn Leas wrote:

> I'm not sure I understand how device nodes on UFS/ext2/etc could be
> pseudolinks to in-core quasi mount points. Don't get me wrong, I
> believe you, I just lack understanding.

Erm... First of all, _every_ inode we are working with is in-core one.
Device inodes are interesting beasts - for some operations you want to
deal with them as with normal on-disk inodes (chown, etc.), for some you
are dealing with the device (e.g. you can open the device on r/o
filesystem with O_WRITE, etc.). There is a lot of special-case code in
fs/* just for dealing with those special cases. Moreover, when we are
dealing with mount/umount we are playing interesting tricks with fake
struct file just to initialize the sucker. Ditto for RAID, etc. Most of
that stuff would go away if we would keep two in-core inodes instead of
one - one of them being the inode from filesystem (bearing things like
ownership, etc.) and another being purely internal. Different device
inodes with the same major/minor would have different fs-related inodes
and the same device-related one. Part of the inode methods belongs to the
former, part - to the latter. Device-related inodes should live on a
separate struct super, not mounted anywhere. Dynamic device
creation/removal belongs there. Fs-related inodes (in-core inodes, that
is) just refer to the device-related ones (linkage done in
init_special_inode() for normal filesystems). BTW, devfs is going to have
an interesting time implementing some analog of revoke() - it can be
mounted many times and VFS code is not too happy with such things.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/