Re: VFS

Andrew E. Mileski (aem@netcom.ca)
Sun, 16 Nov 1997 14:16:58 -0500 (EST)


[CC'd to linux-kernel and linux_udf as this might be useful]

> > You must have missed my message, and never looked at the NFS code.
> > For a unique inode number, cast the memory address of the inode.
>
> I did not miss your message, but I never looked at the NFS code.
>
> If you use memory addresses, you do you make inode numbers constant
> after rebooting, or even between subsequent open(2) calls?

Virtual inode numbers will change everytime iget() is called, they
are only constant as long as the inode is in use [which is the only
time an inode number really matters].

open() looks up inodes through the dcache, which holds inodes
busy (i_count > 0). If the inode isn't in the dcache, then it
is looked up from scratch and will get a new virtual inode number.

For "special" fixed inode numbers, like say for the fs root,
you can use virtual inode numbers that are addresses in the first
page of memory [which are _never_ normally accessed - that page is
reserved in Linux for throwing page faults from null pointers].
This should work on all architectures too. Otherwise, the virtual
inode number of the root directory [and other special inodes]
can be kept in [or located through] the super block "u" field.

The only thing changing inode numbers screws up are the "ls -i"
output (the inode info is meaningless), and VFS messages that
refer to inode numbers.

P.S. I'm not a VFS guru, yet, but I'm sure trying hard to learn :-)

--
Andrew E. Mileski   mailto:aem@netcom.ca