hammer2 - Cleanup hammer2_cluster API
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 30 Mar 2015 02:40:17 +0000 (19:40 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 30 Mar 2015 02:40:17 +0000 (19:40 -0700)
commitb8ba9690ca56cd9ac33ff1a5185ddd164169d9ca
tree5e7a27ef09ac1982f5674d989612dcfd355b1921
parent1aa0974c540405ec1481b056b6b71c7fcc160e59
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).
sys/vfs/hammer2/hammer2.h
sys/vfs/hammer2/hammer2_bulkscan.c
sys/vfs/hammer2/hammer2_chain.c
sys/vfs/hammer2/hammer2_cluster.c
sys/vfs/hammer2/hammer2_freemap.c
sys/vfs/hammer2/hammer2_inode.c
sys/vfs/hammer2/hammer2_iocom.c
sys/vfs/hammer2/hammer2_ioctl.c
sys/vfs/hammer2/hammer2_syncthr.c
sys/vfs/hammer2/hammer2_vfsops.c
sys/vfs/hammer2/hammer2_vnops.c