diff options
Diffstat (limited to 'fs/btrfs/debug-tree.c')
-rw-r--r-- | fs/btrfs/debug-tree.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/btrfs/debug-tree.c b/fs/btrfs/debug-tree.c index d9f36efc3dd1..fd07969600c6 100644 --- a/fs/btrfs/debug-tree.c +++ b/fs/btrfs/debug-tree.c | |||
@@ -10,8 +10,17 @@ | |||
10 | int main(int ac, char **av) { | 10 | int main(int ac, char **av) { |
11 | struct btrfs_super_block super; | 11 | struct btrfs_super_block super; |
12 | struct btrfs_root *root; | 12 | struct btrfs_root *root; |
13 | |||
14 | if (ac != 2) { | ||
15 | fprintf(stderr, "usage: %s device\n", av[0]); | ||
16 | exit(1); | ||
17 | } | ||
13 | radix_tree_init(); | 18 | radix_tree_init(); |
14 | root = open_ctree("dbfile", &super); | 19 | root = open_ctree(av[1], &super); |
20 | if (!root) { | ||
21 | fprintf(stderr, "unable to open %s\n", av[1]); | ||
22 | exit(1); | ||
23 | } | ||
15 | printf("fs tree\n"); | 24 | printf("fs tree\n"); |
16 | btrfs_print_tree(root, root->node); | 25 | btrfs_print_tree(root, root->node); |
17 | printf("map tree\n"); | 26 | printf("map tree\n"); |
@@ -23,5 +32,7 @@ int main(int ac, char **av) { | |||
23 | printf("root tree\n"); | 32 | printf("root tree\n"); |
24 | btrfs_print_tree(root->fs_info->tree_root, | 33 | btrfs_print_tree(root->fs_info->tree_root, |
25 | root->fs_info->tree_root->node); | 34 | root->fs_info->tree_root->node); |
35 | printf("total blocks %Lu\n", btrfs_super_total_blocks(&super)); | ||
36 | printf("blocks used %Lu\n", btrfs_super_blocks_used(&super)); | ||
26 | return 0; | 37 | return 0; |
27 | } | 38 | } |