cvs commit: src/sys/sys namei.h src/sys/kern vfs_syscalls.c

Alfred Perlstein alfred at freebsd.org
Sat Apr 9 06:46:26 PDT 2005


* Jeff Roberson <jroberson at chesapeake.net> [050409 06:33] wrote:
> 
> On Sat, 9 Apr 2005, Alfred Perlstein wrote:
> 
> > * Jeff Roberson <jroberson at chesapeake.net> [050409 05:55] wrote:
> > > On Sat, 9 Apr 2005, Alfred Perlstein wrote:
> > >
> > > > * Jeff Roberson <jeff at FreeBSD.org> [050409 05:04] wrote:
> > > > > jeff        2005-04-09 12:04:36 UTC
> > > > >
> > > > >   FreeBSD src repository
> > > > >
> > > > >   Modified files:
> > > > >     sys/sys              namei.h
> > > > >     sys/kern             vfs_syscalls.c
> > > > >   Log:
> > > > >    - Remove the namei NOOBJ flag.  It is meaningless now.
> > > >
> > > > Please bring this back, it is very useful actually.
> > > >
> > > > It is the flag that happens to tell the underlying FS if the
> > > > vnode is going to be used or not.  Basically, if there will
> > > > be an attribute fetch or an open.
> > > >
> > > > (autofs)
> > >
> > > Nothing presently makes use of it.  And the name is misleading if that's
> > > what you want to use it for.  When someone adds functionality to make use
> > > of this in a filesystem we can revive it easily enough with a better name.
> >
> > I just explained to you that I have functionality that makes use
> > of it right now.  Autofs depends on it.  Please revert it.  If you
> > hate the name NOOBJ then rename it JUSTSTAT or NOOPEN.  Thank you.
> 
> I don't understand, where does autofs inspect this flag?

It allows one to differentiate between calls such as stat(2) and
lstat(2) versus calls like open(2) inside of lookup.

Basically if we see the NOOBJ flag, we know that the kernel is
not opening the file, only doing an attribute fetch.  This means
we can avoid a superfelous mount when the user is just doing
a stat(2).  This is critical for things like gui browsers, 
or doing something like "ls -l" under /auto without it mounting
every single auto mount.

Logic in lookup is as follows:
  the lookup for a node fails
  AND
  the directory is marked as 'dynamic'/'browseable'
  AND
  NOOBJ is set

We create a "bogus" vnode that is returned to the caller with a
refcount of just 1, after the caller does a stat, it will vrele the
vnode and it will be gc'd.

This allows one to do an stat(2)/lstat(2) of an entry under autofs
without forcing a mount of that directory.

This would also be used by NFSv4 to implement the browseable rootfs
thing (I think).

thanks!
-- 
- Alfred Perlstein
- Research Engineering Development Inc.
- email: bright at mu.org cell: 408-480-4684


More information about the cvs-src mailing list