You don't just need a number in inode->i_ino. You also need to be
able to find an inode given that number.
So you need to store all the inodes in a hash table.
But you don't want to penalise non-NFS users.
I would probably:
leave i_ino as set by new_inode
initialise inode->i_generation to CURRENT_TIME
in dentry_to_fh,
check if list_empty(&inode->i_hash)
if it is, then add the inode to some hash table indexed by the
address of the inode
put the address of the inode, i_ino and i_generation in the filehandle
in fh_to_dentry,
lookup the given address in the hash table.
if it is found, check the i_ino and i_generation
That means you are only hashing inodes exported by NFS, and you have
a pretty good guarantee of uniqueness (providing time doesn't go
backwards).
NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/