- hammer show command (running with lo:objid directive specified) goes back to normal iteration once it matches the directive as explained in e7f926a5, however it should not do 'search = NULL;'. This commit adds a field btree_search::normal to do it right.
- The problem with 'search = NULL;' is that when there are many files in a directory (e.g. dragonfly bsd source), different leaf nodes of the same depth could happen to have inodes and dirents with the same lo:objid. In this case it prints '*' only for matched records located under the first leaf node because by the time it comes to the second leaf node the pointer has been set to NULL and NULL won't print '*' (see line 169 and 174 of cmd_show.c).
- In the following example it is expected that both leaf node 29 and 30 print '*' for its records that match 00000001:00000001036af6f7, but the result is it only prints for those under leaf node 29. This commit does that right.
show 800000005b14d000 lo 00000001 obj_id 00000001036af6f7 depth 0
edcc813 sbin/hammer: Make hammer show properly print '*' for elements that match directive
sbin/hammer/cmd_show.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Upstream: gitweb.dragonflybsd.org