[DragonFlyBSD - Submit #2761] (Closed) [PATCH] sbin/hammer: remove obsolete "spike" code from hammer show command

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Tue Jan 20 06:57:40 PST 2015


Issue #2761 has been updated by tkusumi.

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

Applied in changeset commit:20b5b42fc344ef85fa7c31fc99085ab208a2c260.

----------------------------------------
Submit #2761: [PATCH] sbin/hammer: remove obsolete "spike" code from hammer show command
http://bugs.dragonflybsd.org/issues/2761#change-12548

* Author: tkusumi
* Status: Closed
* Priority: Normal
* Assignee: tuxillo
* Category: Userland
* Target version: 4.2.x
----------------------------------------
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
\#


---Files--------------------------------
0001-sbin-hammer-remove-obsolete-spike-code-from-hammer-s.patch (7.92 KB)


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account



More information about the Submit mailing list