git: hammer2 - Implement meta-data statistics rollup

Matthew Dillon dillon at crater.dragonflybsd.org
Thu Jul 31 17:30:18 PDT 2014


commit b3659de2a6ee73b51bf3edb4babfb4653134813f
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu Jul 31 17:22:04 2014 -0700

    hammer2 - Implement meta-data statistics rollup
    
    * HAMMER2 keeps total recursive data and inode count statistics in each
      inode.  This means that one can determine how much storage is being
      used for an entire subdirectory tree simply by doing a 'hammer2 stat <dir>'.
    
    * Implement this by storing temporary rollup adjustments in the hammer2_chain
      structure, then synchronizing those adjustments on insertions, deletions,
      and flushes.
    
      Generally speaking, the chain structure has a data_count, inode_count,
      data_count_up, and inode_count_up for temporary tracking.  The main count
      fields are applied to the current chain AND the parent, while the *_up
      fields are only applied to the parent.
    
      For example, when an inode is inserted its stored statistics must be
      applied to the parent (recursively), but not to itself.
    
    * Preliminary implementation.

Summary of changes:
 sys/vfs/hammer2/hammer2.h         | 15 +++++--
 sys/vfs/hammer2/hammer2_chain.c   | 83 ++++++++++++++++++++++++++++++++++-----
 sys/vfs/hammer2/hammer2_cluster.c | 13 +++---
 sys/vfs/hammer2/hammer2_flush.c   | 35 +++++++++++++++--
 sys/vfs/hammer2/hammer2_freemap.c |  6 ++-
 sys/vfs/hammer2/hammer2_inode.c   | 17 +++++---
 sys/vfs/hammer2/hammer2_vfsops.c  |  2 +-
 7 files changed, 140 insertions(+), 31 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b3659de2a6ee73b51bf3edb4babfb4653134813f


-- 
DragonFly BSD source repository



More information about the Commits mailing list