- We need at least two OCBs with indirect pointers allocated in a 4KB page.
- SBP_MAXPHYS can increase to 1MB once we separate management OCB/ORB
which usually does not need indirect pointers.
- We have to increase SBP_DMA_SIZE for MAXPHYS larger than 1MB.

* This breaks a lot of things. The next few commits will get it all
working again.

* Significantly rework the data structures. Instead of embedding the
RBTREE for a chain's children in the chain, the chain instead points
to a secondary structure containing the RBTREE.

Chains can no longer be moved within the in-memory topology. That is,
if a file is renamed or a block is resized or a block is moved into or
out of an indirect block, the in-memory chain representing that block
is NOT moved. Instead, the in-memory chain is marked deleted and a
copy is created at the new location. Both the old and the new chain
reference the same secondary structure and thus share the same RBTREE,
and reference the same media storage.

In addition, chain->duplink points from the deleted chain to its relocated
copy and maintains a reference on the target until the deleted chain is
deallocated. It is possible for the linked list to span more than one
element.

This link will soon be used to retarget inode->chain pointers (which can
wind up pointing to stale data) and also eventually effect chain->parent
traversals (real parent becomes chain->parent->[duplink*]). A rethink
might be needed down the line.

* This will allow the flush code to run 100% asynchronous from the
frontend and still be able to flush to a synchronization point no
matter how complex a set of changes have occured to the filesystem
concurrent to the flush (but after its synchronization point).

* The change also stabilizes chain->parent, which simplifies quite a bit
of code.

* Simplify nearly all the hammer2_chain_*() API functions, and other
functions.

* Add a hammer2_trans (transaction) structure to keep track of modifying
transactions. This will be flushed out later and used to detect flush
synchronization points. It currently contains the transaction id.

* Start adding API infrastructure and start reworking the flush and other
tree-modifying code to work under the new abstraction.

** New features
--new-file (-N) and --unidirectional-new-file now allow comparisons to
"-". A standard input that's closed acts like a nonexistent file.

A file name containing spaces, double quotes, backslashes or control
characters is now encoded in a diff header as a double-quoted C string
literal. The escape sequences \\, \", \a, \b, \f, \n, \r, \t, \v and
\ooo (a three-digit octal number between 0 and 255) are used.

=== 2.13 Bug fixes ===
* grep -i, in a multi-byte locale, when matching a line containing a character
like the UTF-8 Turkish I-with-dot (U+0130) (whose lower-case representation
occupies fewer bytes), would print an incomplete output line.
Similarly, with a matched line containing a character (e.g., the Latin
capital I in a Turkish UTF-8 locale), where the lower-case representation
occupies more bytes, grep could print garbage.
[bug introduced in grep-2.6]
* --include and --exclude can again be combined, and again apply to
the command line, e.g., "grep --include='*.[ch]' --exclude='system.h'
PATTERN *" again reads all *.c and *.h files except for system.h.
[bug introduced in grep-2.6]

=== New 2.13 features ===
* 'grep' without -z now treats a sparse file as binary, if it can
easily determine that the file is sparse.

New Features / API changes:
Added new API member XML_SetHashSalt() that allows setting an intial
value (salt) for hash calculations. This is part of the fix for
bug #3496608 to randomize hash parameters.
When compiled with XML_ATTR_INFO defined, adds new API member
XML_GetAttributeInfo() that allows retrieving the byte
offsets for attribute names and values (patch #3446384).
Added CMake build system.
See bug #2990652 and patch #3312568.
Added run-benchmark target to Makefile.in - relies on testdata module
present in the same relative location as in the repository.

* antarctica/australasia/zone.tab: Fix times of habitation for Macquarie
to agree with the Tasmania Parks & Wildlife Service history, which
indicates that permanent habitation was 1899-1919 and 1948 on. It is
politically part of Australia, not Antarctica. (Thanks to Tobias
Conradi.) Also, sort Macquarie more consistently with other parts of
Australia. (Thanks to Tim Parenti.)

* asia: Palestine observed DST starting March 29, 2013. (Thanks to
Steffen Thorsen.) From 2013 on, Gaza and Hebron both observe DST,
with the predicted rules being the last Thursday in March at 24:00
to the first Friday on or after September 21 at 01:00. Also, fix
some historical data for Palestine to agree with that of
timeanddate.com.

* southamerica: Assume that the recent change to Paraguay's DST rules is
permanent, by moving the end of DST to the 4th Sunday in March every
year. (Thanks to Carlos Raul Perasso.)

* A type-o in the load calculation code was not counting niced
processes at all, so if you have a lot of niced processes
(like ffmpeg's which nice themselves down), powerd can wind
up restricting them all to a single cpu. Doh!

There were three main problems with the recently added backup feature:
1. It didn't work over NFS
2. It didn't work when a non-root built world the second time
3. It didn't use DESTDIR which had potential to conflict backups

It also previously featured "NO_BACKUP" which turned off the automatic
backup feature. To fix the #2 problem, the install timestamp has been
removed, so to avoid unwanted backups for multiple installworlds after
one buildworld, the user needs to pass NO_BACKUP in the command line.

This patch was contributed by Thomas Nikolajsen with minor modifications
added by John Marino.

The RX standard ring descriptors and RX standard producer index register
are updated only in the dedicated thread. The RX standard ring software
ring data are shared between RX return rings' processing threads and the
dedicated thread. The RX standard ring software ring data are updated in
lockless fashion, since only one RX return ring could be the owner of the
entry of RX standard ring software ring data.

The RX standard ring refilling thread scheduling is optimized that only
when certain amount of packets are received by the RX return ring, the
RX standard ring refiling thread will be scheduled.

It is a common practice to bind UDP socket to multicast address to enjoy
kernel level destination multicast address and port filtering. However,
if data are sent on this kind of socket, source address of the IP packet
will be the bound multicast address?!

Two fixes are added to address this bug:

1) Don't set IP source address in udp_output(), if the inpcb's laddr is
multicast address. Instead the IP source address is set to INADDR_ANY,
so ip_output() could pick up a proper IP source address.

2) With 1) in place, it is possible that IP source address is INADDR_ANY
before the ifnet.if_output() using following steps:
- If the IP_MULTICAST_IF socket option is set to iface0
- The iface0's last IP address is unset, before the ip_output()

This condition could easily be reproduced by using test/mcast:
mcast -m 224.2.2.2 -p 3000 -i iface0_ip -D 10
During the 10sec delay, wipe out all IP addresses from iface0

Well, even without 1), raw IP still could generate IP packet using
INADDR_ANY as source address.

Two checks on the source IP address are added to ip_output() before
ifnet.if_output()
- IP source address should not be INADDR_ANY
- IP source address should not be multicast address

And for multicast IP packets, if the IP source address could be
determined, they will not be looped back and forwarded.