diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-03-20 20:35:03 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-03-20 20:35:03 -0400 |
commit | b55672a2a1694d27b73f8233efcc1d986bfc797a (patch) | |
tree | 604f172298f25475b12c08cc2c98e24ffee91b1c /debug-tree.c | |
parent | ab61081c6c29bac69c5d3ea47cbd3c4352f79aea (diff) |
Better block record keeping, real mkfs
Diffstat (limited to 'debug-tree.c')
-rw-r--r-- | debug-tree.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/debug-tree.c b/debug-tree.c index d9f36efc..fd079696 100644 --- a/debug-tree.c +++ b/debug-tree.c @@ -10,8 +10,17 @@ int main(int ac, char **av) { struct btrfs_super_block super; struct btrfs_root *root; + + if (ac != 2) { + fprintf(stderr, "usage: %s device\n", av[0]); + exit(1); + } radix_tree_init(); - root = open_ctree("dbfile", &super); + root = open_ctree(av[1], &super); + if (!root) { + fprintf(stderr, "unable to open %s\n", av[1]); + exit(1); + } printf("fs tree\n"); btrfs_print_tree(root, root->node); printf("map tree\n"); @@ -23,5 +32,7 @@ int main(int ac, char **av) { printf("root tree\n"); btrfs_print_tree(root->fs_info->tree_root, root->fs_info->tree_root->node); + printf("total blocks %Lu\n", btrfs_super_total_blocks(&super)); + printf("blocks used %Lu\n", btrfs_super_blocks_used(&super)); return 0; } |