hammer2 - Add truncation lock, change dio persistence
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 10 Jun 2016 18:09:29 +0000 (11:09 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 10 Jun 2016 18:12:24 +0000 (11:12 -0700)
commit63be6fedbdb22faa0427ad4d674c904d5f5bdf89
treebdb076b1dae3556f37b45afeb0440e282113b770
parentb1969588c5c80496332804bc895aee82ff51d671
hammer2 - Add truncation lock, change dio persistence

* Add a truncation lock to interlock between write()'s and ftruncate()
  calls.  This prevents a junk buffer from surviving a ftruncate() if
  it happens to get written concurrently with the ftruncate().

* Change dio persistence.  Do not automatically persist dio's while refs
  are held, this creates problems for ref'd chains held in the
  hammer2_inode_t structure and prevents vfsync() from working properly.

  Add a persist_refs field which we will use later in the XIO code to
  persist a chain's DIO across an unlock/relock sequence, and possibly
  in other places too.
sys/vfs/hammer2/hammer2.h
sys/vfs/hammer2/hammer2_chain.c
sys/vfs/hammer2/hammer2_vnops.c