Hi!

> > > For 1) the VFS needs to be modified, but with infinitesimal
> > > performance effect. For 2) a kernel module could be used.
> 
> Erm? Negative lookup happens every time when you are creating an object.

The added code to VFS is this:

    if (lookup_global && !dentry->d_inode)
        lookup_global(nd, dentry);

There are two cases:

  1) The user doesn't want virtual files -- lookup_global is NULL: The
      performance impact is two assembly instructions. That _is_
      infinitesimal.

  2) The user wants virtual files: The performance impact is an
     strchr() on every negative looked up name. Still not that great
     deal.

> > > Problems:
> > > 
> > >  - The filesystem will be littered with these loopback mounts. This
> > >    should be cleared upon unmount, and possibly when the dcache is
> > >    shrunk. There was a similar requirement for new autofs IIRC.
> 
> Not with the dcache shrinking.

I'm not sure I understand. If something is mounted somewhere, then it
will dget() the mountpoint, and mntget() the parent mount. So neither
the mountpoint dentry can be shrunk away, nor the parent mount can be
umounted. So upon umount, before the cache shrinking, these extra
mountpoints need to be cleared. No?

> How will it interact with modifying the mount-tree?
> 

How will _what_ interact, with modifying the mount-tree by _whom_?

> Comment on autofs is pretty interesting, though. Sigh... Just let me find
> some time to do mount-traps - that may very well be the right tool here...

Just ideas on this: 

- vfsmount needs some operations:

  o lookup -- trap for mounting
  o umount -- to be invoked when the parent mount is umounted. This is
              what the virtual file mounts need as well.
  o ?? mount -- invoked when the parent is loopback mounted somewhere.

BTW: I'm interested in the union mount stuff mentioned earlier on this
list. Is the code available somewhere?

Miklos

Reply via email to