Add journaling restart support, required to produce a robust journaling
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 13 Jul 2005 02:00:19 +0000 (02:00 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 13 Jul 2005 02:00:19 +0000 (02:00 +0000)
commit500b6a229686896bb964b4f98efdd7c3f149801d
tree17643b6eb0eaed068028cfc02aead489e44030aa
parent004d2de5f7def3d613003ed0bdb21016df0a3582
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.
sbin/mountctl/mountctl.8
sbin/mountctl/mountctl.c
sys/kern/vfs_jops.c
sys/kern/vfs_journal.c
sys/sys/journal.h
sys/sys/mountctl.h