Suppose we change the way we play the game a fraction and the NFS daemon
allocates some blocks of "index pages" according to system memory/load
whatever.
On the filehandle you provide an index value. We take that value and
do something like
base=handle&255;
offset=(handle0x3FF00)>>8; /* 1K */
We now make
dentry **base[256];
and each pointer points to 1 page which is a page of dentry pointers.
At boot we may well allocate a lot less than 256 pages but we set the pointers
to point to share pages across multiple entries.
This means we can now do
dentry=find_dentry(base,offset);
if(inode_of(dentry)!=handle->inode && [ other tests here ])
{
dentry=find_dentry(...)
store_dentry(base,offset,dentry)
}
and find_dentry might even magic up stuff - either by searching or by
using an "open by inode" hack. We can now at least cache the most recent
dentry matching a base,offset hash - and it could be made a better cache
algorithm if appropriate
Alan