sys/vfs/hammer: Erase layer2 entries on removing volume
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 20 Mar 2016 16:31:48 +0000 (01:31 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Mon, 21 Mar 2016 18:46:55 +0000 (03:46 +0900)
commitc7fc3243262be620521d3c0d0c40c8385ad5c226
treec19be6ca17bb4d9ccbc1b7bf8ff425abf28f90de
parent2f1df9cece2c18f660b07748af682ac3c47cc50f
sys/vfs/hammer: Erase layer2 entries on removing volume

Since hammer volume-del puts layer1 entries back to UNAVAIL,
it should zero clear layer2 entries within those layer1s.
We basically want to get rid of all meta data that belonged
to this volume, not just volume header and layer1 entries.

(Layer2 entries in this volume become unreachable data after
layer1 entries lose an offset to layer2s thus should be zero
cleared.)

This commit makes this function look redundant with two full
loops of layer1/2, but this is what's necessary and makes it
more readable plus easier to conform to the original design
than having for-loop function with callback handlers.

Also see d8d6680 and de75bb2.
sys/vfs/hammer/hammer_volume.c