Project

General

Profile

Submit #2761

[PATCH] sbin/hammer: remove obsolete "spike" code from hammer show command

Added by tkusumi about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Userland
Target version:
Start date:
01/07/2015
Due date:
% Done:

100%


Description

This patch removes spike related code from print_btree_node(). The idea of spike type node (HAMMER_BTREE_TYPE_SPIKE_XXX) within the hammer btree has been removed since 47197d71536907482d2d215e222600eed3aedc0e in 2008. Prior to 47197d71 there was a special case where a leaf node's element was a spike node, and such data structure required hammer show command recursively call hammer_cmd_show() (see 47197d71 -- sbin/hammer/cmd_show.c).

Since now that spike node is gone, calling print_btree_node() with int spike=1 (in addition to int spike=0 case) is no longer relevant as spike=1 goes down through btree doing nothing. spike=1 currently does nothing to result because it neither goes to "if (spike == 0) { ..." block nor recursively calls hammer_cmd_show(). This patch simply gets rid of spike code as well as fixing indents for "if (spike == 0) { ..." block, and nothing else.

Following test shows there is no diff between two results. Note that I've reverted a commit ffb1cc63 (on top of this patch at my local git work branch) only for this test so the output format equals that of 4.0 inbox binary which was built prior to ffb1cc63. This patch itself applies to the latest upstream master.

\# uname -r
4.0-RELEASE

creat fs and poplulate fs with bunch of inode/dentry/data.

\# mkdir -p /HAMMER
\# newfs_hammer -L TEST /dev/ad1 /dev/ad2 /dev/ad3 > /dev/null
\# mount_hammer /dev/ad1:/dev/ad2:/dev/ad3 /HAMMER
\# cd /HAMMER
\# git clone git://git.dragonflybsd.org/dragonfly.git > /dev/null
\# git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > /dev/null
\# cd

try the original /sbin/hammer and this patch

\# umount /HAMMER
\# mount_hammer /dev/ad1:/dev/ad2:/dev/ad3 /HAMMER
\# /sbin/hammer -f /dev/ad1:/dev/ad2:/dev/ad3 show > out1
\# umount /HAMMER
\# mount_hammer /dev/ad1:/dev/ad2:/dev/ad3 /HAMMER
\# ~/work/dragonfly/sbin/hammer/hammer -f /dev/ad1:/dev/ad2:/dev/ad3 show > out2

compare results

\# grep ELM ./out1 | wc -l
330370
\# grep ELM ./out2 | wc -l
330370
\# diff out1 out2
\#

try the original /sbin/hammer and this patch with localization:obj_id specified

\# umount /HAMMER
\# mount_hammer /dev/ad1:/dev/ad2:/dev/ad3 /HAMMER
\# /sbin/hammer -f /dev/ad1:/dev/ad2:/dev/ad3 show 00000001:0000000102c8eef7 > out1
\# umount /HAMMER
\# mount_hammer /dev/ad1:/dev/ad2:/dev/ad3 /HAMMER
\# ~/work/dragonfly/sbin/hammer/hammer -f /dev/ad1:/dev/ad2:/dev/ad3 show 00000001:0000000102c8eef7 > out2

compare results

\# grep ELM out1 | wc -l
200971
\# grep ELM out2 | wc -l
200971
\# diff out1 out2
\#

Associated revisions

Revision 20b5b42f (diff)
Added by tkusumi about 2 years ago

sbin/hammer: remove obsolete "spike" code from hammer show command

- Remove spike related code from print_btree_node() as it is no longer
relevant since commit 47197d.
- Not calling print_btree_node() twice makes 'show' directive more
efficient.

Closes: #2761

Revision 3196a49f (diff)
Added by tkusumi about 2 years ago

sbin/hammer: remove obsolete "spike" code from hammer show command

- Remove spike related code from print_btree_node() as it is no longer
relevant since commit 47197d.
- Not calling print_btree_node() twice makes 'show' directive more
efficient.

Closes: #2761

History

#1 Updated by tuxillo about 2 years ago

  • Assignee set to tuxillo
  • Target version set to 4.2.x

#2 Updated by tkusumi about 2 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF