Rework and expand the algorithms in JSCAN, part 4/?.
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 7 Sep 2005 02:34:37 +0000 (02:34 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 7 Sep 2005 02:34:37 +0000 (02:34 +0000)
commitc3172c11806ac146d25ef57a2b74ca5951fb1cdd
treefed7902288b700099e983a188e83aa765ee68d02
parent9b23f2eba67602166b3dc48adbad5c4effbc13e3
Rework and expand the algorithms in JSCAN, part 4/?.

* Fix a bug in the handling of PAD records.  PAD records are special cased
  records in that the transaction id field may not be valid.  This occurs
  because a PAD record must be able to fill up the alignment space, which
  is only 16 bytes.  The journal_rawrecend structure winds up overlapping the
  transid of the journal_rawrecbeg structure in such cases.  We must skip
  such records.

* Fix a bug in jfile->jf_pos tracking when doing forward scans.  Since we
  supporting being able to scan forwards or reverse from any point, we
  have to properly track the file seek offset for forward scans.

Tested with /usr/obj recorded (-r) and mirrored (-m) through a buildworld.
A diff -r after the buildworld completed showed a perfect copy!  The
buildworld with both forward and reverse (undo) journaling enabled
generated 24 50MB journal files (1.2 GB of journal data).
sbin/jscan/jfile.c