hammer2 - Implement meta-data statistics rollup
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 1 Aug 2014 00:22:04 +0000 (17:22 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 1 Aug 2014 00:22:04 +0000 (17:22 -0700)
commitb3659de2a6ee73b51bf3edb4babfb4653134813f
tree4f52c590496fe7e38113ae06171563a8c3782493
parent8b903fd1eacef97441cec7995222faf0ec46d265
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.
sys/vfs/hammer2/hammer2.h
sys/vfs/hammer2/hammer2_chain.c
sys/vfs/hammer2/hammer2_cluster.c
sys/vfs/hammer2/hammer2_flush.c
sys/vfs/hammer2/hammer2_freemap.c
sys/vfs/hammer2/hammer2_inode.c
sys/vfs/hammer2/hammer2_vfsops.c