See the design document below for details of HAMMER2.
https://gitweb.dragonflybsd.org/dragonfly.git/blob/HEAD:/sys/vfs/hammer2/DESIGN
Note that clustering support mentioned in the design document is
unimplemented even in DragonFly, so this patch doesn't either. This
patch provides read-only local mount.
The patch consists of new code only, and it doesn't make any change
to the existing subsystems. New files are under BSDL except for Zlib.
It's been compiled and tested on amd64 and i386.
* sys/fs/hammer2 - HAMMER2 file system.
The code is rewritten based on DragonFly. Some files are mostly
portable as they don't directly talk to VFS or GEOM, but others are
not hence rewritten. Things only used by write support are mostly
removed. Rewrite includes conforming to style(9) where possible.
* sys/fs/hammer2/zlib - Zlib implementation used by HAMMER2.
HAMMER2 can use Zlib for compression. FreeBSD has sys/contrib/zlib
with seemingly newer version, but it can't simply be used as drop-in
replacement due to symbol conflict with other part of the kernel.
* sbin/hammer2 - HAMMER2 file system utility.
Implements directives many of which invoke HAMMER2 ioctls. The code
is basically same as DragonFly, except that write (creation) related
directives, clustering related directives, and directives with
assumption on DragonFly specific device name are all removed.
* sbin/newfs_hammer2 - HAMMER2 newfs command.
The code is basically same as DragonFly, but this command could be
dropped if that's preferred. This command enables you to at least
test mounting empty file system without using existing images.
* sbin/mount_hammer2 - HAMMER2 mount command.
All it does is invoke mount syscall, but the code is rewritten to use
FreeBSD specific nmount(2) syscall.
* sbin/fsck_hammer2 - A simple ondisk (hashed radix tree) checker.
The code is basically same as DragonFly.