aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/debug-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-20 20:35:03 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-20 20:35:03 -0400
commit1261ec42b3d3a3ad878bd172144940e3ac710749 (patch)
tree4b317d8fa13e56a5dd02f37605b9fed5952d723a /fs/btrfs/debug-tree.c
parent293ffd5fd340428276fbbd24ce7b98bf6728466b (diff)
Btrfs: Better block record keeping, real mkfs
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/debug-tree.c')
-rw-r--r--fs/btrfs/debug-tree.c13
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 @@
10int main(int ac, char **av) { 10int 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}