hammer2 - Initial HARDLINK -> DIRENT replacement code
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 25 Jul 2017 02:05:33 +0000 (19:05 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 25 Jul 2017 02:05:33 +0000 (19:05 -0700)
commitda0cdd33148ab3e3c227355de759c595c533841a
tree055a55b61a7a2d7331824040cdb522cac769a377
parent6d9d83d8169ddea0b9680b376a850934a456bb55
hammer2 - Initial HARDLINK -> DIRENT replacement code

* Initial removal of the vestiges of the old embedded inode code.  Inodes
  were moved to the root directory long ago but directories still contain
  dummy OBJTYPE_HARDLINK inodes instead of real directory entries to point
  to the moved inodes.  These inodes ate 1024 bytes of disk space for each
  directory entry.

* Remove the dummy OBJTYPE_HARDLINK inodes and replace with new
  BREF_TYPE_DIRENT blockrefs.  These blockrefs represent directory
  entries, and the entire dirent will fit in the blockref (requiring
  no data ref) if the filename is <= 64 bytes.

* This new DIRENT mechanic significantly improves performance and reduces
  storage overage vs the previous mechanicn, for obvious reasons.

  Directory entries are now 128 bytes instead of 1024 bytes, and since they
  are collected together in indirect blocks or (if <= 4 entries) simply
  placed in the 4 blockrefs embedded in the directory inode, the related
  I/O tends to be fairly optimal.

  Only directory entries whos filenames are > 64 bytes long require an
  additional data block reference.  For now, due to other constraints,
  we use the minimum H2 allocation size of 1KB for these, so certainly
  space is wasted.  But in real life there aren't actually a whole lot
  of filenames that are that long so it should be fine.
18 files changed:
lib/libstand/hammer2.c
sbin/hammer2/cmd_debug.c
sbin/hammer2/subs.c
sys/vfs/hammer2/hammer2.h
sys/vfs/hammer2/hammer2_bulkfree.c
sys/vfs/hammer2/hammer2_chain.c
sys/vfs/hammer2/hammer2_disk.h
sys/vfs/hammer2/hammer2_flush.c
sys/vfs/hammer2/hammer2_freemap.c
sys/vfs/hammer2/hammer2_inode.c
sys/vfs/hammer2/hammer2_io.c
sys/vfs/hammer2/hammer2_ioctl.c
sys/vfs/hammer2/hammer2_strategy.c
sys/vfs/hammer2/hammer2_subr.c
sys/vfs/hammer2/hammer2_synchro.c
sys/vfs/hammer2/hammer2_vfsops.c
sys/vfs/hammer2/hammer2_vnops.c
sys/vfs/hammer2/hammer2_xops.c