Project

General

Profile

Submit #2740 ยป 0001-sbin-hammer-fix-output-of-hammer-blockmap-command.patch.txt

tkusumi, 11/27/2014 11:04 AM

 
1
From: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
2
Date: Fri, 28 Nov 2014 3:40:53 +0900
3
Subject: [PATCH] sbin/hammer: fix output of hammer blockmap command
4

    
5
I think "zone btree" of the following should be "zone freemap" since this whole L1/L2 iteration of 8MB chunks deals with freemap zone, but not disk space for btree zone.
6

    
7
> # hammer -f /dev/ad1:/dev/ad2:/dev/ad3 blockmap
8
> zone btree            next 2000000000000000 alloc 2fffffffffffffff
9
>   layer1 4000000000000000 @2000000000800000 blocks-free 1204
10
>         4000000000000000 zone=4 app=8388608 free=0
11
>         4000000000800000 zone=4 app=8388608 free=0
12
>         4000000001000000 zone=3 app=8388608 free=0
13
>         4000000001800000 zone=3 app=8388608 free=0
14
>         4000000002000000 zone=3 app=8388608 free=0
15
>         4000000002800000 zone=3 app=8388608 free=0
16
>         4000000003000000 zone=3 app=8388608 free=0
17

    
18
I git blamed to find where this commit was made which was da44aa75 in 2008. From what has been #if0-ed, it seems to me "btree" literal should be "freemap".
19

    
20
> commit da44aa75b99217e2bd602254eb232a2c14453c39
21
> Author: Matthew Dillon <dillon@dragonflybsd.org>
22
> Date:   Sat Jul 19 18:48:15 2008 +0000
23
>
24
>     HAMMER Utilities: Sync with HAMMER 65.
25
> ...
26
> diff --git a/sbin/hammer/cmd_blockmap.c b/sbin/hammer/cmd_blockmap.c
27
> index 24174ac..b772e21 100644
28
> --- a/sbin/hammer/cmd_blockmap.c
29
> +++ b/sbin/hammer/cmd_blockmap.c
30
> @@ -31,18 +31,17 @@
31
> ...
32
>  void
33
>  hammer_cmd_blockmap(void)
34
>  {
35
> +       dump_blockmap("btree", HAMMER_ZONE_FREEMAP_INDEX);
36
>  #if 0
37
>         dump_blockmap("btree", HAMMER_ZONE_BTREE_INDEX);
38
>         dump_blockmap("meta", HAMMER_ZONE_META_INDEX);
39
> @@ -51,7 +50,7 @@ hammer_cmd_blockmap(void)
40
>  #endif
41
>  }
42
---
43
 sbin/hammer/cmd_blockmap.c | 2 +-
44
 1 file changed, 1 insertion(+), 1 deletion(-)
45

    
46
diff --git a/sbin/hammer/cmd_blockmap.c b/sbin/hammer/cmd_blockmap.c
47
index 86bc2cb..15ebd67 100644
48
--- a/sbin/hammer/cmd_blockmap.c
49
+++ b/sbin/hammer/cmd_blockmap.c
50
@@ -58,7 +58,7 @@ static void dump_collect(collect_t collect);
51
 void
52
 hammer_cmd_blockmap(void)
53
 {
54
-	dump_blockmap("btree", HAMMER_ZONE_FREEMAP_INDEX);
55
+	dump_blockmap("freemap", HAMMER_ZONE_FREEMAP_INDEX);
56
 }
57
 
58
 static
59
-- 
60
1.9.3
61

    
    (1-1/1)