hammer2 - Add indirect block creation
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 18 Feb 2012 02:36:24 +0000 (18:36 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 18 Feb 2012 02:51:27 +0000 (18:51 -0800)
commit995e78dc6e7daf6175ad24433f16cfd2c8062507
treec0ca54eff7247203a3917004ab8382320a20312c
parent6ec7720b0769ed7fa2e862407d5f9977830f2c1d
hammer2 - Add indirect block creation

* hammer2_chain_create_indirect() is now called by hammer2_chain_create()
  when the current parent is full and an indirect block is needed to
  open up new slots.

  This function scans the key/keybits for all the entries in the parent and
  calculates the key/keybits representing the range, inclusive of the
  key/keybits we were trying to insert when we ran out of room.

  The range is then bisected and the low or high side is selected for
  indirect block replacement.  The indirect block is created and the low
  or high side elements are moved into the indirect block.  The function
  then returns and hammer2_chain_create() retries.

* Implement the HAMMER2_CHAIN_MOVED flag.  This flag is set in a chain
  element that has been moved into an indirect block, allowing flushes
  to detect the condition and update the element in the indirect block
  during the flush operation.

  We also subtley use NOLOCK in a few places since there is no need to
  actually load the contents of the entries being moved.

* Correct issues related to iterating through indirect blocks that came
  up in testing.

* Tested with mkdir > 8 entries.
sys/vfs/hammer2/TODO [new file with mode: 0644]
sys/vfs/hammer2/hammer2.h
sys/vfs/hammer2/hammer2_chain.c
sys/vfs/hammer2/hammer2_disk.h
sys/vfs/hammer2/hammer2_vnops.c