Re: file system building

Bill Hawes (whawes@star.net)
Thu, 01 Jan 1998 21:23:35 -0500


Magnus Ahltorp wrote:

> The problem is, when the inode is cached in the dcache, it must have been
> created by the iget(sb,xnode), and the reference count should be 0 (if
> noone uses it). But, if I let the reference count drop to 0, the inode
> will be deallocated. If I then do a dcache lookup, I will get an inode
> number that does not map to an inode anymore. I will try to do an
> iget(sb,xnode) on it, but since my read_inode does not do much, I get
> something completly useless.

Inodes being held by the dcache should have a use count of 1 -- the
normal state of an inode in use is that only the dentry has a reference
to it. The life of the dentry then determines the life of the inode;
when the dentry is released, the inode count goes to 0 and the inode is
usually freed almost immediately.

Regards,
Bill