VFS messaging/interfacing work stage 7c/99: More firming up of stage 7.
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 4 Oct 2004 09:20:43 +0000 (09:20 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 4 Oct 2004 09:20:43 +0000 (09:20 +0000)
commit8c361dda31a84321b0875a6f31dc7904f550ec68
treec8520c12066ea17923b0a7e05efe3a52e3cb5d33
parent3c9234994e844bc65e64dfb7bb685d9885818477
VFS messaging/interfacing work stage 7c/99: More firming up of stage 7.

Make a minor change to cache_alloc()'s semantics by having it returned a
ref'd locked ncp.  Make the same change to cache_allocroot().

Fix a bug in the resolver that could deadlock a namecache and vnode lock by
unlocking the namecache node before locking the vnode.  This hack is only
needed until the old API has been removed.

Get rid of the old API compat code that tried to create dummy ncp's for
directory vnodes that did not have one and then merge old and new, it got
too messy.  The idea was to be able to cache things in the middle of the
topology and then hook the topology up later when we knew the path.

Instead, the old API simply does not enter things into the namecache
if the parent directory vnode has not namecache structure associated
with it.  This maintains the unbroken topology that we want to guarentee
at the cost of the old API functions potentially not caching as much
information.  [ since kern_open(), [f]chdir(), and [f]stat() execute the
new API the loss of efficiency in the old API should not be noticeable ].

When cache_enter() re-enters the same vnode, it was zaping the old namecache
structure unnecessarily and causing problems with directories.  It no longer
does this.

NFS CHANGE: get rid of the va_ctime vs n_ctime test.  This test was supposed
to detect server-side directory changes and purge the directory, but half the
time it purged the directory anyway.  The new API requires that the directory
topology remain intact so only purge if the directory is found not to exist.
This change may have to be revisited later.

NOTE: cache_nlookup() is sensitive to the directory topology when traversing
".." directories.  If a directory in the middle of the topology is purged
it can cause the new API lookup to fail with EXDEV.

Bug-reports-by: drhodus, various other people.
sys/kern/init_main.c
sys/kern/vfs_cache.c
sys/kern/vfs_default.c
sys/vfs/nfs/nfs_vnops.c