hammer2 - refactor filesystem sync 4/N
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 13 Nov 2018 21:32:33 +0000 (13:32 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 5 Dec 2018 18:28:39 +0000 (10:28 -0800)
commit6f445d15835c6677a0a79c8d168ef44d0b9b22c3
tree6def4bebce52f0428bc8e11cb3957f0997cb0d0d
parent3e8408db42a34d0449b1ca212b77cd7b5e9a21b3
hammer2 - refactor filesystem sync 4/N

* Save synchronized iroot blockmaps for snapshot code, and use them
  in the snapshot code.

* Improve dependency handling and syncq/sideq flagging for
  dependencies.  Also improve the hammer2_inode_t reordering
  code that allows the frontend to continue operating on dirty
  inodes simultaneous with a filesystem sync.

* Move inode deletion into the filesystem sync code (in addition to
  creation), for the same reason.

* Fix lost ref counts in the snapshot code which were causing umount
  panics.

* Stabilization pass on volume flush code.  Since flushes stop at
  inode boundaries, we must properly flush the superroot before
  flushing the volume header.  That is, the flush sequence is:

  - flush inodes for PFS  (flushes inode content)
  - flush PFS root inode  (flushes through to inodes)
  - flush superroot inode (flushes through to PFS root)
  - flush volume header   (flushes voulume header to superroot)

  Theoretically this allows the filesystem asynchronously write data
  and inodes flushed by the kernel's buffer cache and vnode code
  concurrent with a filesystem flush without messing up filesystem
  consistency, because these asynchronously flushed inodes are not
  included (or have already been flushed) in the filesystem flush that
  is already underway.

* Filesystem consistency still not perfect (using snapshot-debug
  directive to test during heavy filesystem modification loads,
  directory entries are sometimes desynchronized from their inodes).
sys/vfs/hammer2/hammer2.h
sys/vfs/hammer2/hammer2_flush.c
sys/vfs/hammer2/hammer2_inode.c
sys/vfs/hammer2/hammer2_ioctl.c
sys/vfs/hammer2/hammer2_vfsops.c
sys/vfs/hammer2/hammer2_vnops.c