kernel - Fix bug when running swapon a gpt slice

* diskpsize() and related API functions to obtain the number of blocks
  in a disk specification was punting if there was no dragonfly disklabel.
  This path was being specifically used by swapon.

* Do not require a dragonfly disklabel when the whole-slice partition is
  specified (i.e. /dev/daXsY with no a...z suffix).

* Swapon now works on gpt swap slices.

Reported-by: julianp
pwd(1), realpath(1): Split shared source file into separate ones

The realpath(1) and pwd(1) programs share the same source file using the
program name as a condition.  Let's create a dedicated directory for
realpath, duplicate the source file, then tailor both.  Not only is this
more logical, it will make maintenance easier in the (near) future.
realpath(1): Sync with FreeBSD to add -q option

If -q is specified, warnings will not be printed out when realpath(3) fails.
pwd(1): Sync with FreeBSD (very minor, mainly editorial)
find(1): Sync with FreeBSD

Originally I did this to gain the -quit feature.  It turns out that we
already had it, but FreeBSD didn't document it until 4 years after they
implemented it, so it wasn't on our man page either.

With this sync, we get time comparisons down to the nanosecond.  We get
the -sparse option.  The behavior of -delete was changed the delete the
files given as arguments.

The only thing that was omitted with all the birthtime options.
The new find was used successfully in locate.update job, something
that failed in the last sync and code in functions.c had to be
partially reverted.
pgrep(1), pkill(1): Sync with FreeBSD to get the -F options

These functions haven't been touched since DragonFly 1.1 (2004), other
than build tweaks.  It was claimed that it would be "trivial" to add
the -F options (pid file) but I wouldn't classify it as such.  There
is a pretty big diff between the FreeBSD and DragonFly 1.1 version.  I
had make some modifications, but the functions appear to work in the
very short tests that I performed.
pwait(1): Import from FreeBSD, built without modification!
Fix world build bootstrapping issue

The new version of find(1) uses a new locale function called rpmatch.
The use of this function breaks the world build on systems that don't
have the new locale functionality yet, e.g. Release 3.4.

To fix this, I added a BOOTSTRAPPING macro that will check the
first letter of the response character array rather than use the
locale function.  This modification appears only in the bootstrap tool.
netinet/in.h: Add missing IPPORT_MAX definition

Obtained-from: FreeBSD
kernel - Greatly improve concurrent fork's and concurrent exec's

* Rewrite all the vm_fault*() API functions to use a two-stage methodology
  which keeps track of whether a shared or exclusive lock is being used
  on fs.first_object and fs.object.  For most VM faults a shared lock is
  sufficient, particularly under fork and exec circumstances.

  If the shared lock is not sufficient the functions will back-down to an
  exclusive lock on either or both elements.

* Implement shared chain locks for use by the above.

* kern_exec - exec_map_page() now attempts to access the page with a
  shared lock first, and backs down to an exclusive lock if the page
  is not conveniently available.

* vm_object ref-counting now uses atomic ops across the board.  The
  acquisition call can operate with a shared object lock.  The deallocate
  call will optimize decrementation of ref_count for values above 3 using
  an atomic op without needing any lock at all.

* vm_map_split() and vm_object_collapse() and associated functions are now
  smart about handling terminal (e.g. OBJT_VNODE) VM objects and will use
  a shared lock when possible.

* When creating new shadow chains in front of a OBJT_VNODE object, we no
  longer enter those objects onto the OBJT_VNODE object's shadow_head.
  That is, only DEFAULT and SWAP objects need to track who might be shadowing
  them.  TODO: This code needs to be cleaned up a bit though.

  This removes another exclusive object lock from the critical path.

* vm_page_grab() will use a shared object lock when possible.
drm: Define BITS_PER_LONG

At the same time, rename a macro of the same name in drm_atomic.h. They
both have the same meaning but the one in drm_atomic.h uses sizeof(),
which prevents from using it inside an #if preprocessor condition.
drm: Add a local implementation of linux/hash.h

* Implement hash_long() as a wrapper on top of the existing
  hash32_buf() function
drm: Add a local implementation of linux/export.h

* The Linux drm files often contain EXPORT_SYMBOL() macros

* We don't /need/ them but keeping them unchanged in the drm
  files helps reducing differences with Linux
drm: Replace drm_linux_list.h by linux/list.h ...

... from FreeBSD's OFED stack

* Keep a few missing functions and macros
drm: Add linux/compiler.h from the FreeBSD OFED stack
drm - Fix kernel compile

* Linux's LIST_HEAD interferes with ours.  Rename as it was previously
  renamed from LIST_HEAD to DRM_LIST_HEAD.  Also, other source files
  already assumed DRM_LIST_HEAD.

* Fixes kernel compile
kernel - Concurrent fork/exec (2)

* Fix bug in vm_fault() path that can cause a token live lock.
  When taking a write fault first_shared must be set to 0
  because the fault might involve calling swap_pager_unswapped(),
  which currently requires an exclusive VM object lock.
drm: Rename DRM_LIST_HEAD to LINUX_LIST_HEAD

It is supposed to be the well-known Linux LIST_HEAD() macro after all
drm: Replace BSD and legacy DRM macros by Linux mechanisms

Reducing differences with Linux
drm: Add hlist RCU macros