Initial commit of Wasabi System's WAPBL (Write Ahead Physical Block
Logging) journaling code.  Originally written by Darrin B. Jewell
while at Wasabi and updated to -current by Antti Kantee, Andy Doran,
Greg Oster and Simon Burge.

Still a number of issues - look in doc/BRANCHES for "simonb-wapbl"
for more info.
Revert my suggested fix for kern/38655 - that shouldn't have snuck in
to this branch.
Fix a couple of typos.  From wizd.
Comment out the behaviour change that requires "mount -f ..." to mount
a dirty filesystem.
Fix some whitespace and long line niggles.
License police
Sync with head.
- Remove wapbl_global_mtx, use atomic-ops for reference counting;
- Move few pool_put() calls out of the locked code area;

OK by <simonb>.
In wapbl_stop(), destroy the condvars/mutexes/locks created in
wapbl_start().  Fixes a LOCKDEBUG panic.
Fix reference counting for pool initialisation - atomic_inc_uint_nv()
will return 1 (not 0!) for the first time a value is incremented.
Use local "nameiop" variable instead of cnp->cn_nameiop as the rest of
this function already does.
Use "%#x" to print hex values instead of "%x" - this made it really hard
to tell hex from decimal values especially when no observed values had
any a-f digits.
Do the UFS_WAPBL_UPDATE() after the call to UFS_TRUNCATE(), not before.

From Greg Oster.
Fix some white-space nits.
Reset fdp->i_count to 0 if the current directory offset is at the start
of a directory block, otherwise ufs_dirremove() will try to compact the
current entry onto the end of the last entry of the previous directory
block past the end of that block.

Thanks to Greg Oster for help debugging and fixing this.
Add a comma to printf format string missing in previous.
In wapbl_ufs_rename() make sure we read in the next filesystem
block if we pass the end of the current block.  Fixes all sorts
of nasty directory lossage when the stars are aligned correctly.
Sync with head.
Sync with head.
Revert local changes that were not meant to be in previous "sync with
head" commit.