The new VOP_N*() (namespace) operations pass a pointer to a namecache
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 13 Aug 2007 17:43:57 +0000 (17:43 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 13 Aug 2007 17:43:57 +0000 (17:43 +0000)
commitdff430ab95c038114b46b996c42ec22ba7b00264
treebc2bd6087ffdf660f146c55eeff3aaeaeb796467
parent08daea96d5363623d97d234947462e820b910270
The new VOP_N*() (namespace) operations pass a pointer to a namecache
record.  This information is sufficient for resolving the namespace
operation.  In all cases the parent namecache record already had to have
a resolved vnode so the related directory vnode could be easily extracted
by the VFS.  But this also means the target VFSs had to traverse the
namecache topology up one level which introduced API pollution that
is not compatible with directly translating a VOP to a RPC.

To solve this we now pass a directory vnode along with the namecache pointer.
This vnode is only held, not referenced or vget()d so the target VFS must
still vget() the vnode and/or do whatever it needs to do to validate it.
This gives the target VFS full control over directory locking when performing
namespace operations.  The namespaces themselves are already guarenteed
to be locked due to the fact that the related namecache records are locked.

This change is being made to accomodate USERFS, so we can directly translate
the related VOPs to RPCs without having to reproduce the namecache topology
in the target VFS running in userland.
sys/kern/uipc_usrreq.c
sys/kern/vfs_cache.c
sys/kern/vfs_default.c
sys/kern/vfs_syscalls.c
sys/kern/vfs_vnops.c
sys/kern/vfs_vopops.c
sys/sys/vfsops.h
sys/vfs/nfs/nfs_vnops.c