git: hammer2 - Add feature to allow sector overwrite, fix meta-data check code
Matthew Dillon
dillon at crater.dragonflybsd.org
Sat Jul 9 16:24:57 PDT 2016
commit 7fece146f268d677c46bde997079860f4cf553d0
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Sat Jul 9 16:17:19 2016 -0700
hammer2 - Add feature to allow sector overwrite, fix meta-data check code
* If a file is set to use no check code (hammer2 setcheck none <file>),
data overwrites will reuse the same sector as long as it does not violate
the most recent snapshot.
This allows the program to relax copy-on-write requirements for certain
files, for example files which might be mmap()'d SHARED+RW and then
modified constantly where the programmer has determined that the
possibility of corruption is ok.
* Implement pfs_lsnap_tid in the PFS root inode meta-data. This records the
last snapshot TID so the chain code can determine if an overwrite is
allowed.
* Remove attr_tid and dirent_tid from the inode meta-data for now.
* Only BREF_TYPE_DATA brefs inherit the inode check mode. Meta-data brefs
such as indirect blocks, or directory entries, will only use the check
code type specified in the parent inode if it is not NONE. Otherwise
they will use the default check code.
This fixes a bug where meta-data brefs could wind up being unchecked. We
want all meta-data to always be checked (at least for now).
Summary of changes:
sys/vfs/hammer2/DESIGN | 17 +++++++---
sys/vfs/hammer2/hammer2.h | 4 +--
sys/vfs/hammer2/hammer2_chain.c | 64 +++++++++++++++++++++++++++++++-------
sys/vfs/hammer2/hammer2_disk.h | 18 +++++++++--
sys/vfs/hammer2/hammer2_flush.c | 2 +-
sys/vfs/hammer2/hammer2_freemap.c | 6 ++--
sys/vfs/hammer2/hammer2_inode.c | 5 +--
sys/vfs/hammer2/hammer2_ioctl.c | 17 +++++++---
sys/vfs/hammer2/hammer2_strategy.c | 10 +++++-
sys/vfs/hammer2/hammer2_synchro.c | 17 +++++++---
sys/vfs/hammer2/hammer2_xops.c | 9 ++++--
11 files changed, 129 insertions(+), 40 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/7fece146f268d677c46bde997079860f4cf553d0
--
DragonFly BSD source repository
More information about the Commits
mailing list