commit edcc81367d0db0fcc368d69238683f756c9a17de
Author: Tomohiro Kusumi kusumi.tomoh...@gmail.com
Date: Fri Mar 20 22:09:51 2015 +0900
sbin/hammer: Make hammer show properly print '*' for elements that match
directive
- 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 0001:0001036af6f7,
but the result is it only prints for those under leaf node 29.
This commit does that right.
show 80005b14d000 lo 0001 obj_id 0001036af6f7 depth 0
snip
NODE 80005b04e000 cnt=37 p=80005b14e000 type=I depth=2
mirror 0001040192b0 fill=z8:182=92% {
G-- ELM 0 L lo=0001 obj=00010354f711 rt=01
key= ot=00
snip
G-- ELM 29 L lo=0001 obj=0001036af6e9 rt=01
key= ot=00
tids 000104018910:
suboff=800020fb1000 mirror 000104018a50 *
G-- ELM 30 L lo=0001 obj=0001036af6f7 rt=11
key=66ea1f6ab72c ot=00
tids 000104018a50:
suboff=80005b079000 mirror 000104018a50 *
Summary of changes:
sbin/hammer/cmd_show.c | 10 ++
1 file changed, 6 insertions(+), 4 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/edcc81367d0db0fcc368d69238683f756c9a17de
--
DragonFly BSD source repository