kernel - Fix tty cool-aid

* Fix a tty crash in the ^T handling code.  The code can race LWP
  destruction and blow up.
kernel - Attempt to fix NULL pointer dereference during console switch

* Attempt to fix NULL pointer dereference during console switch.
  Bug 2481.

Reported-by: marino
kernel - Fix deadlock when umount races an access on the underlying filesystem

* The nlookup code temporarily busies the target mount when diving a
  mount point in cases where the base of the mount is not resolved
  in the namecache.

* Fix a deadlock which can occur between the namecache structural lock
  and the vfs_busy() on the mount structure by reordering the lock.

* Generally only occured if an attempt was made to unmount a filesystem
  on which programs are still doing active operations (verses just
  passively holding references to the filesystem).  For example, a
  umount on the target filesystem occuring while a cpdup using an
  absolute path is running.

Reported-by: ftigeot
Merge branch 'master' into gsocdrm_jfree
hammer2 - Start working on the freemap (note: freemap not yet operational)

* hammer2 show now tries to dump all four volume headers

* Minimum storage allocation chunk size is 1K, increase MIN_RADIX and
  MIN_ALLOC appropriately.

* Preliminary reserved block mappings for the freemap indirect and bitmap
  blocks.

* Preliminary freemap design will use normal indirect blocks (but with
  a different bref.type name).  The check area of the bref will be used to
  store additional freemap hints.

  The volume header will contain a blockref to the root of the freemap,
  and newfs_hammer2 now initializes this blockref.

* Bring major hammer2_disk.h media structure comments up to snuff.

* Formalize blockref.methods and set proper defaults.  This field contains
  the crc/check and compression methods for a blockref.
usb4bsd: Add missing parameter to ue_start().

Submitted-by:  Yellow Rabbit <yrabbit@sdf.lonestar.org>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/2503>
hammer2 - serialized flush work part 1

This is preliminary work required to support chain structure replication
for the purposes of recording modifications which are then separated by
serialization points (by transaction id).  Ultimately this will allow the
flush code to flush to an exact serialization point and in the process
operate completely asynchronously from any further modifications being
made on the frontend after that serialization point.

* Separate hammer2_inode from hammer2_chain.

* Split the locking APIs for inodes and chains into their own functions.

* Move ip_data into chain->data->ipdata (kmalloc'd), instead of embedding
  it in hammer2_inode.  This allows the inode structure to disconnect from
  the chain.
hammer2 - serialized flush work part 2

* Adjust the hammer2_inode_lock*() API to separate the inode lock from
  the chain lock (it gets both).  The locked chain associated with the
  inode is now returned and can change during search iterations, eventually
  to be returned via hammer2_inode_unlock*().

* Fixes issues related to threads obtaining more than 1 shared lock on the
  same chain, which can deadlock deeper procedures which might need to
  temporarily upgrade the lock.

* Continue working through bugs.
libstdc++47: Fix iostream bug 2478

c++ iostreams were segfaulting -- apparently _M_table isn't defined in all
cases.  Fix inspired from FreeBSD configuration files.

https://bugs.dragonflybsd.org/issues/2478
Remove legacy lex source files

The ancient lex was replaced by flex recently.  The bootstrapping issue
seems to be solved, so let's go ahead and purge lex from base now.
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
hammer2 - serialized flush work part 3

* Clean up hammer2_inode vs hammer2_chain.  Remove chain->u.ip (the
  backpointer from the chain to the inode), which simplifies a lot
  of things.  This was only used to detect when a vnode might have to
  be recycled but we solve that a different way by adjusting the
  kernel's cache_unlink() code.

* Revamp hammer2_inode_get().  This routine now always kmalloc()'s a new
  hammer2_inode.  In HAMMER2, the hammer2_inode structure is actually
  an indirect pointer to an underlying chain so it does not have to be
  unique.  There can multiple ip's pointing to the same chain.

* Revamp hammer2_inode_put().  The ref on ip->chain is dropped via ip->chain,
  and the (passed_chain) argument is treated separately and does not
  necessarily have to match ip->chain.  This makes hammer2_inode_put()'s API
  comparable to hammer2_inode_unlock_ex(), reducing confusion.

* Depend on adjustments to cache_unlink() and cache_rename() to detect
  vnodes which should be recycled.  This code (in the proper kernel, not
  here) now triggers a deactivation if the vnode related to the namecache
  entry has no refs, allowing HAMMER2 to detect any deletions and vrecycle()
  the vnode immediately.

* Numerous ref/lock fixes.
Merge branch 'master' into gsocdrm_github