Add journaling restart support, required to produce a robust journaling
environment. If a journal is writing to one stream and the stream breaks
or dies or otherwise fails, this feature gives us the ability to restart the
journaling stream on a new descriptor without losing any data. The
journaling restart code does a shutdown() of the old descriptor, waits for
both directions to cease operation, installs a new stream descriptor,
and resets the FIFO index to the last acknowledged offset.
This can be demonstrated by opening two windows. In the first window do:
mountctl -a2 /usr:test | jscan -d2 stdin
Mess around a bit on /usr. Then in the second window do:
mountctl -r2 /usr:test | jscan -d2 stdin
The first jscan will terminate and the new jscan will pick up the stream.