git: hammer2 - Cleanup hammer2_cluster API

Matthew Dillon dillon at crater.dragonflybsd.org
Sun Mar 29 19:50:14 PDT 2015


commit b8ba9690ca56cd9ac33ff1a5185ddd164169d9ca
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sun Mar 29 19:40:17 2015 -0700

    hammer2 - Cleanup hammer2_cluster API
    
    * Track whether a cluster structure is locked or not.  For the upcoming
      cluster locking code, cluster structures cannot be recursively locked
      (though you can always make a copy and lock that).
    
    * Move the ddflag (direct-data-in-inode) flag into the cluster structure
      And remove it from a number of API calls.
    
    * Add fields and flags in preparation for more formalized locking and
      tracking of clusters.
    
    * Refactor code to remove hammer2_cluster_replace() and
      hammer2_cluster_replace_locked().  This involves changing
      hammer2_hardlink_find() and a few other things.
    
    * Refactor the cluster focus code.  cluster->focus is only set and valid
      when a cluster is locked.  Do not set it as a side effect of other
      operations.
    
    * Refactor chain validation in hammer2_cluster_lookup() and add it to
      hammer2_cluster_next().
    
    * Add the concept of a read-only cluster lock which will allow upcoming
      cluster locking code to reduce the number of chains that actually
      get locked or undergo I/O.
    
    * In strategy file writing code call hammer2_cluster_modify_ip()
      only when the inode itself is being modified by the write() due
      to being in OPFLAG_DIRECTDATA mode (when 512 bytes of data is embedded
      in the inode).

Summary of changes:
 sys/vfs/hammer2/hammer2.h          |  29 +++++---
 sys/vfs/hammer2/hammer2_bulkscan.c |   4 +-
 sys/vfs/hammer2/hammer2_chain.c    |  24 +------
 sys/vfs/hammer2/hammer2_cluster.c  | 144 +++++++++++++++++++++++++++++--------
 sys/vfs/hammer2/hammer2_freemap.c  |   7 +-
 sys/vfs/hammer2/hammer2_inode.c    | 135 ++++++++++++++++++----------------
 sys/vfs/hammer2/hammer2_iocom.c    |   3 +-
 sys/vfs/hammer2/hammer2_ioctl.c    |  10 ++-
 sys/vfs/hammer2/hammer2_syncthr.c  |  16 ++++-
 sys/vfs/hammer2/hammer2_vfsops.c   |  86 ++++++++++++----------
 sys/vfs/hammer2/hammer2_vnops.c    |  22 +++---
 11 files changed, 293 insertions(+), 187 deletions(-)

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


-- 
DragonFly BSD source repository



More information about the Commits mailing list