sys/vfs/hammer: Add -A option to reblock|rebalance all pfs

Operating Systems / DragonFlyBSD - Tomohiro Kusumi [gmail.com] - 28 April 2015 10:36 UTC

- -A option makes certain per pfs hammer commands perform on all pfs of the filesystem that the [filesystem] arg belongs to. Currently hammer reblock and rebalance commands support this. It does nothing to other commands.

- With -A option, above hammer commands use a range of 0 to 0xFFFF for pfs id (upper 16 bits) of the cursor localization. This makes it iterate all pfs in the filesystem.

- Above difference in localization range means btree iteration applies to larger range of nodes in terms of pfs id, since it's been used as a top priority key that works as a localizing factor of pfs within the btree. There is no logical difference other than the range is different. So performing these commands on all pfs is as simple as changing the localization range (unless other keys are involved as additional parameters like hammer prune does).

5e1e145 sys/vfs/hammer: Add -A option to reblock|rebalance all pfs
sbin/hammer/cmd_rebalance.c | 1 +
sbin/hammer/cmd_reblock.c | 1 +
sbin/hammer/hammer.8 | 19 ++++++++++++++++++-
sbin/hammer/hammer.c | 8 ++++++--
sbin/hammer/hammer.h | 1 +
sys/vfs/hammer/hammer_ioctl.h | 5 +++--
sys/vfs/hammer/hammer_rebalance.c | 8 ++++++--
sys/vfs/hammer/hammer_reblock.c | 8 ++++++--
8 files changed, 42 insertions(+), 9 deletions(-)

Upstream: gitweb.dragonflybsd.org


  • Share