VFS messaging/interfacing work stage 4/99. This stage goes a long ways
authorMatthew Dillon <dillon@dragonflybsd.org>
Sat, 28 Aug 2004 19:02:35 +0000 (19:02 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sat, 28 Aug 2004 19:02:35 +0000 (19:02 +0000)
commit3446c007ff08b0252748d2e1775c7c04e5bef050
tree222486e069a07ee4d9d97a06f91f556268013576
parentee7990a0cff3bca73ea287a5a41d65b68630f45d
VFS messaging/interfacing work stage 4/99.  This stage goes a long ways
towards allowing us to move the vnode locking into a kernel layer.  It
gets rid of a lot of cruft from FreeBSD-4.  FreeBSD-5 has done some of this
stuff too (such as changing the default locking to stdlock from nolock),
but DragonFly is going further.

* Consolidate vnode locks into the vnode structure, add an embedded v_lock,
  and getting rid of both v_vnlock and v_data based head-of-structure locks.

* Change the default vops to use a standard vnode lock rather then a fake
  non-lock.

* Get rid of vop_nolock() and friends, we no longer support non-locking
  vnodes.

* Get rid of vop_sharedlock(), we no longer support non standard shared-only
  locks (only NFS was using it and the mount-crossing lookup code should
  now prevent races to root from dead NFS volumes).

* Integrate lock initialization into getnewvnode().  We do not yet
  incorporate automatically locking into getnewvnode().  getnewvnode()
  now has two additional arguments, lktimeout and lkflags, for lock
  structure initialization.

* Change the sync vnode lock from nolock to stdlock.  This may require more
  tuning down the line.  Fix various sync_inactive() to properly unlock
  the lock as per the VOP API.

* Properly flag the 'rename' vop operation regarding required tdvp and tvp
  unlocks (the flags are only used by nullfs).

* Get rid of all inode-embedded vnode locks

* Remove manual lockinit and use new getnewvnode() args instead.
  Lock the vnode prior to doing anything that might block in
  order to avoid synclist access before the vnode has been properly
  initialize.

* Generally change inode hash insertion to also check
  for a hash collision and return failure if it occurs,
  rather then doing (often non-atomic) relookups and
  other checks.  These sorts of collisions can occur
  if a vnode is being destroyed at the same time a new
  vnode is being created from an inode.  A new vnode is
  not generally accessible, except by the sync code (from
  the mountlist) until it's underlying inode has been hashed
  so dealing with a hash collision should be as simple as
  throwing away the vnode with a vput().

* Do not initialize a new vnode's v_data until after
  the associated inode has been successfully added to
  the hash, and make the xxx_inactive() and xxx_reclaim()
  code friendly towards vnodes with a NULL v_data.

* NFS now uses standard locks rather then shared-only locks.

* PROCFS now uses standard locks rather then non-locks, and PROCFS's
  lookup code now understands VOP lookup semantics.  PROCFS now uses
  a real hash table for its node search rather then a single singly-linked
  list (which should better scale to systems with thousands of processes).

* NULLFS should now properly handle lookup() and rename() locks.  NULLFS's
  node handling code has been rewritten.  NULLFS's bypass code now understands
  vnode unlocks (rename case).

* UFS no longer needs the ffs_inode_hash_lock hacks.  It now uses the new
  collision-on-hash-add methodology.   This will speed up UFS when operating
  on lots of small files (reported by David Rhodus).
51 files changed:
sys/emulation/linux/i386/linprocfs/linprocfs_subr.c
sys/kern/kern_lock.c
sys/kern/vfs_default.c
sys/kern/vfs_subr.c
sys/kern/vfs_vopops.c
sys/sys/lock.h
sys/sys/namecache.h
sys/sys/vnode.h
sys/vfs/coda/cnode.h
sys/vfs/coda/coda_vnops.c
sys/vfs/fdesc/fdesc_vnops.c
sys/vfs/gnu/ext2fs/ext2_vfsops.c
sys/vfs/hpfs/hpfs.h
sys/vfs/hpfs/hpfs_vfsops.c
sys/vfs/hpfs/hpfs_vnops.c
sys/vfs/isofs/cd9660/cd9660_node.c
sys/vfs/isofs/cd9660/cd9660_node.h
sys/vfs/isofs/cd9660/cd9660_vfsops.c
sys/vfs/mfs/mfs_vfsops.c
sys/vfs/msdosfs/denode.h
sys/vfs/msdosfs/msdosfs_denode.c
sys/vfs/msdosfs/msdosfs_vnops.c
sys/vfs/nfs/nfs_node.c
sys/vfs/nfs/nfs_vnops.c
sys/vfs/nfs/nfsnode.h
sys/vfs/ntfs/ntfs_inode.h
sys/vfs/ntfs/ntfs_vfsops.c
sys/vfs/nullfs/null.h
sys/vfs/nullfs/null_subr.c
sys/vfs/nullfs/null_vnops.c
sys/vfs/nwfs/nwfs_node.c
sys/vfs/portal/portal_vfsops.c
sys/vfs/portal/portal_vnops.c
sys/vfs/procfs/procfs_subr.c
sys/vfs/procfs/procfs_vfsops.c
sys/vfs/procfs/procfs_vnops.c
sys/vfs/smbfs/smbfs_node.c
sys/vfs/smbfs/smbfs_node.h
sys/vfs/smbfs/smbfs_vnops.c
sys/vfs/udf/udf_vnops.c
sys/vfs/ufs/ffs_vfsops.c
sys/vfs/ufs/inode.h
sys/vfs/ufs/ufs_extern.h
sys/vfs/ufs/ufs_ihash.c
sys/vfs/ufs/ufs_inode.c
sys/vfs/ufs/ufs_vnops.c
sys/vfs/umapfs/umap.h
sys/vfs/umapfs/umap_subr.c
sys/vfs/umapfs/umap_vnops.c
sys/vfs/union/union_subr.c
sys/vm/vm_swap.c