All you need is _some_ dentry not _the_ dentry. The dentries already
handle inodes with multiple links -- make up a new dentry and pretend
this is another.
Seems to me you can create a single superblock for knfsd (which need
not necessarily be on the regular list of superblocks), use d_alloc_root
to instantiate a special inode to do the dirty work. You'd not ever
let this new dentry get collected. (This does not affect the collection
of its children, correct?)
File handles now only need device and inode numbers. To look them
up in the cache, you render "dev.ino" in ascii, and give lookup_dentry
the special root dentry we created earlier. If the dentry is in the
cache, we're happy. If it isn't, i_op->lookup on our special inode
interprets the "dev.ino", calls back to get_super and iget, and does
the standard thing after that.
Am I missing something?
r~