hammer2 - Refactor flush
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 30 Oct 2013 07:13:34 +0000 (00:13 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 1 Nov 2013 06:08:38 +0000 (23:08 -0700)
commita7720be71b29acdd1e64c3c5a95c9aa0fb204e25
treeda0efa4db10784d8888344e57e74d9311675b814
parent058ba4030941fcdd26edb17f02dd27b72bf88938
hammer2 - Refactor flush

* Replace HAMMER2_CHAIN_SUBMODIFIED with core->update_tid.  SUBMODIFIED
  applies to chain->core, not to chain. Use a TID to track updates to
  make it easier for a flush to update records without messing up flush
  sequencing of chains being concurrently modified outside the flush's
  TID (that will be handled in the next flush).

* Make sure the DUPLICATED flag is set when duplicating a chain which
  has already been duplicated to another target.  This case is only during
  flushes and can occur when the flush races against concurrent updates
  which are not part of the flush.

* Refactor bioq flushing during a flush.  hammer2_vfs_sync now gives the
  bioq a window to operate using the flush's TID before the flush actually
  starts to flush.

* hammer2_chain_modify() retains the current allocation block if the TID
  does not cross a flush boundary.

* chain->bref.mirror_tid is now used to track flush progress and is compared
  against core->update_tid to determine when a flush is needed.

* Code cleanups.
sys/vfs/hammer2/hammer2.h
sys/vfs/hammer2/hammer2_chain.c
sys/vfs/hammer2/hammer2_flush.c
sys/vfs/hammer2/hammer2_freemap.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