git: hammer2 hammer2 - Add indirect block creation

Matthew Dillon dillon at
Fri Feb 17 18:51:34 PST 2012

commit 995e78dc6e7daf6175ad24433f16cfd2c8062507
Author: Matthew Dillon <dillon at>
Date:   Fri Feb 17 18:36:24 2012 -0800

    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.

Summary of changes:
 sys/vfs/hammer2/TODO            |   15 ++
 sys/vfs/hammer2/hammer2.h       |    1 +
 sys/vfs/hammer2/hammer2_chain.c |  373 +++++++++++++++++++++++++++++++++++++--
 sys/vfs/hammer2/hammer2_disk.h  |    6 +-
 sys/vfs/hammer2/hammer2_vnops.c |    8 +-
 5 files changed, 386 insertions(+), 17 deletions(-)
 create mode 100644 sys/vfs/hammer2/TODO

DragonFly BSD source repository

More information about the Commits mailing list