hammer2 - Refactor file unlink w/open descriptor
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 11 Dec 2013 21:33:11 +0000 (13:33 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 11 Dec 2013 21:50:09 +0000 (13:50 -0800)
commit044541cda0f600de451eb349ab34dda763328d00
tree6c003a23b89d19035893fbba7267408725650491
parent1715ee4d21b7b113643b88138708c0d65e13850e
hammer2 - Refactor file unlink w/open descriptor

* Remove the H2 special cases for the HAMMER2_CHAIN_DELETED flag.  These
  special cases existed to deal with the unlink-open-file case, but hackish
  and didn't deal with all the issues (such as bulk-free scan code losing
  track of the unlinked open file).

* Change the unlink case when the file is still open or mmap'd.  Instead of
  deleting the inode H2 will now move the inode to a hidden directory in
  the mount root.  This way the bulk freeing code still sees it.

  When the inode is moved it is re-keyed to its inode number, thus guaranteed
  not to conflict with anything else sitting in the hidden directory.

* Add code to create the hidden directory in the mount root if it does not
  exist.

* Add code to wipe the contents of the hidden directory on-mount (as a crash
  recovery mechanic).
sys/vfs/hammer2/hammer2.h
sys/vfs/hammer2/hammer2_chain.c
sys/vfs/hammer2/hammer2_disk.h
sys/vfs/hammer2/hammer2_flush.c
sys/vfs/hammer2/hammer2_inode.c
sys/vfs/hammer2/hammer2_ioctl.c
sys/vfs/hammer2/hammer2_vfsops.c
sys/vfs/hammer2/hammer2_vnops.c