git: sys/vfs/hammer: Fix/rewrite hammer_free_freemap()
tkusumi at crater.dragonflybsd.org
Sat Mar 19 14:27:45 PDT 2016
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date: Fri Mar 11 23:49:15 2016 +0900
sys/vfs/hammer: Fix/rewrite hammer_free_freemap()
This commit rewrites hammer_free_freemap() used by hammer volume-del
in order to handle layer2 layout change by the previous commit.
The functional difference (other than the layout difference) is
that this commit through for-loop twice. This is to separate
counting busy layer2 and zero clearing layer1. Layer1 zero clear
should be done only when all layer2 are empty, so no ondisk change
occurs until it's ready to erase ondisk layer1. It previously had
these two in the same loop, which means if the volume consisted
of >1 layer1 it could happen to find out the volume wasn't ready
to remove after it has zero cleared layer1 entry(s).
This commit adds prototype for hammer_iterate_l1l2_entries().
This was added only to avoid compile error for not using it.
hammer_iterate_l1l2_entries() will be removed in the next commit.
(Removing it in this same commit makes default git diff without
any option unclear)
This commit does not affect a volume that was previously added
by hammer volume-add when removing that volume via hammer volume-del
after this commit. HAMMER reads layer2 offset from ondisk layer1
entries (and layer1 layout hasn't changed), so the change made by
the previous commit to conform to the original design doesn't
depend on the code once it's added.
Summary of changes:
sys/vfs/hammer/hammer_volume.c | 169 ++++++++++++++++++++++++++---------------
1 file changed, 107 insertions(+), 62 deletions(-)
DragonFly BSD source repository
More information about the Commits