hammer2 - freemap part 4, misc fixes
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 13 Jun 2013 07:11:04 +0000 (00:11 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 13 Jun 2013 07:11:04 +0000 (00:11 -0700)
commit93f3933ac3e2ad37a7ba775663c711b13588f147
tree36c4bfd2b5d867dcb3546b33fea8d36866394e96
parenta2988f1b83fa9cb2f86aec6ae08e5df76f0bf8ec
hammer2 - freemap part 4, misc fixes

* Revamp the freemap a bit.  Remove Layer 0.  Layer 1 is now the LEAF.
  2GB of media storage is now represented by a single 64KB Layer 1 block.
  Synchronize the FREEMAP document with the current thinking.

  The Layer 1 block contains 1024x64 entries.  Each entry represents 2MBytes
  of media storage.  These entries are no longer blockrefs pointing to
  Layer 0 but are instead terminal structures.

* Each entry represents a 16KB allocation granularity in 2 bits and has
  128 bit pairs (256 bits total), plus additional information to represent
  the 2MBytes of storage.

  Fine-grained allocations are supported via an iterator field, currently
  allowing fine-grained allocations down to 1KB and potentially expandable
  in the future to even smaller allocation sizes.

* Fix a SMP race in voldata handling during flush.  The freemap portion of
  voldata could be updated during crc calculations due to hmp->fchain not
  being held locked, causing random volume header/backups to fail their CRC
  test on remount.

* Add missing BUF_KERNPROC() when chain->bp is replaced.  Fixes a kernel
  lock ownership assertion.

* Add freezone/radix fields to the inode_data structure.  Each inode can
  accomodate four fields.  The fields are not yet utilized.  Current thinking
  is to use them to optimize the bulk free-scan for freeing blocks.
sbin/hammer2/cmd_debug.c
sbin/hammer2/cmd_stat.c
sys/vfs/hammer2/FREEMAP
sys/vfs/hammer2/hammer2_chain.c
sys/vfs/hammer2/hammer2_disk.h
sys/vfs/hammer2/hammer2_flush.c
sys/vfs/hammer2/hammer2_freemap.c
sys/vfs/hammer2/hammer2_subr.c