hammer2 - Flush sequencing
* Add a flag HAMMER2_CHAIN_DIRTYBP to differentiate between clean and
dirty buffers, separate from HAMMER2_CHAIN_MODIFIED1. We needed a
new flag because a buffer can be dirtied and then written out by the
OS (becoming clean) before the chain hierarchy itself is flushed.
This fixes an issue where a small percentage of buffers were being
written out several times without any new changes.
* Clean up HAMMER2_CHAIN_IOFLUSH and implement to reduce double buffering
overheads, at least for the buffer cache. The VM backing store might
still have double-buffered data.
This reduces the load on the buffer management code in the kernel and
helps avoid potential deadlocks.
* Unlock the inode when stalling in bwillwrite(). This solves a problem
where a program stuck in flstik can also stall out the buffer daemons.