Re: Extra per-inode data

Bill Hawes (whawes@star.net)
Wed, 28 Jan 1998 21:00:45 -0500


Martin Mares wrote:

> I'm now playing with some filesystem capable of >4G files and I need to
> store lot of data (approx. 1K) per inode, so I decided to use the inode->u.generic_ip
> field to point to my local data instead of putting it directly to the inode structure.
> But it seems that there is no way to free such data when the inode gets flushed
> out of the inode cache (it can be still reused after super_ops->put_inode gets called).
>
> The only solution I see is to introduce a new super_op called from clear_inode
> to free such auxiliary data (see the patch below). Does anybody have a better idea?

Adding a clear_inode operation sounds reasonable to me, and it fills in the gap
of functionality between put_inode and delete_inode. There's a simpler solution
if the inodes won't be on the dirty list at put_inode time, which is to just
clear i_nlink and let delete_inode do the cleanup. With the dcache in place
there's no longer a need to retain inodes after being freed from their dentry,
unless they need to be written out to disk in the sync process.

Regards,
Bill