sbin/hammer: Fix and change hammer show behavior when only lo is used
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Mon, 21 Sep 2015 10:34:10 +0000 (19:34 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Thu, 24 Sep 2015 14:09:55 +0000 (23:09 +0900)
commit34909d8efe3ec8b36ce26db951ee1812b346476b
tree72cf75661565f009f5bcdfbc86a272413e07005c
parent47fc33819c3bf4fc72d6d50cdaff5801cdf8735f
sbin/hammer: Fix and change hammer show behavior when only lo is used

913b6663 has expanded hammer show's B-Tree directive from
lo:objid
to
lo:objid:rectype:key:tid
which allowed hammer show to filter B-Tree iteration in the
same way that the actual filesystem does on B-Tree lookup.

There was an exception in 913b6663 where one could not just
use lo directive, but was forced to use at least the first
two directives lo:objid. If objid wasn't specified then
HAMMER_MIN_OBJID was used for objid by default.

This was to keep compatibility with old behavior before
913b6663 added the rest of the directives (rectype:key:tid),
but this old behavior wasn't really useful for anything and
rather confusing given that all unspecified fields (after
the last specified field) except for objid were wildcard.
See sbin/hammer/hammer.c and sbin/hammer/cmd_show.c before
913b6663 (or really old one like v4.0 era) for details.

This commit normalizes this exceptional behavior and make
all option directives behave the same way. For example, if
*only* lo field is specified, then the rest of the fields
are wildcard. If the first n fields are specified, then the
remaining (5-n) fields are wildcard.

This does change the behavior when *only* lo is specified,
but the change should make the behavior less confusing.

Also update hammer(8) manpage since it hasn't been updated.
sbin/hammer/cmd_show.c
sbin/hammer/hammer.8