HAMMER 43/Many: Remove records from the media format, plus other stuff
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 12 May 2008 21:17:18 +0000 (21:17 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 12 May 2008 21:17:18 +0000 (21:17 +0000)
commit11ad5ade53acef8ab34bba4f79733dd46153ecce
tree8b11b8af7a320cf4bde815b2796625f1eab1525e
parente2c9718c790b9e1a08b260a7a5a8996f142da405
HAMMER 43/Many: Remove records from the media format, plus other stuff

* Get rid of hammer_record_ondisk.  As HAMMER has evolved the need for
  a separate record structure has devolved into trivialities.  Originally
  the idea was to have B-Tree nodes referencing records and data.  The
  B-Tree elements were originally intended to be throw-away and the on-media
  records were originally intended to be the official representation of
  the data and contained additional meta-information such as the obj_id
  of a directory entry and a few additional fields related to the inode.

  But once the UNDO code went in and it became obvious that the B-Tree needed
  to be tracked (undo-wise) along with everything else, the need for an
  official representation of the record as a separate media structure
  essentially disappeared.

  Move the directory-record meta-data into the directory-entry data and move
  the inode-record meta-data into the inode-record data.  As a single
  exception move the atime field to the B-Tree element itself (it replaces
  what used to be the record offset), in order to continue to allow atime
  updates to occur without requiring record rewrites.  With these changes
  records are no longer needed at all, so remove the on-media record structure
  and all the related code.

* The removal of the on-media record structure also greatly improves
  performance.

* B-Tree elements are now the official on-media record.

* Fix a race in the extraction of the root of the B-Tree.

* Clean up the in-memory record handling API.  Instead of having to
  construct B-Tree leaf elements we can simply embed one in the in-memory
  record structure (struct hammer_record), and in the inode.
20 files changed:
sbin/hammer/cmd_show.c
sbin/hammer/cycle.c
sbin/hammer/hammer_util.h
sbin/hammer/ondisk.c
sbin/newfs_hammer/newfs_hammer.c
sys/conf/files
sys/vfs/hammer/hammer.h
sys/vfs/hammer/hammer_btree.c
sys/vfs/hammer/hammer_btree.h
sys/vfs/hammer/hammer_cursor.c
sys/vfs/hammer/hammer_cursor.h
sys/vfs/hammer/hammer_disk.h
sys/vfs/hammer/hammer_inode.c
sys/vfs/hammer/hammer_ioctl.c
sys/vfs/hammer/hammer_object.c
sys/vfs/hammer/hammer_ondisk.c
sys/vfs/hammer/hammer_prune.c [copied from sys/vfs/hammer/hammer_ioctl.c with 57% similarity]
sys/vfs/hammer/hammer_reblock.c
sys/vfs/hammer/hammer_subs.c
sys/vfs/hammer/hammer_vnops.c