summaryrefslogtreecommitdiff
path: root/print-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2010-04-06 09:30:17 -0400
committerChris Mason <chris.mason@oracle.com>2010-04-06 09:30:17 -0400
commit075587c96c2f39e227847d13ca0ef305b13cd7d3 (patch)
tree849aca32b8beb2349dbc2e697b460690eb47f67c /print-tree.c
parent8f55b769c703c3f7cc8c94d165ea2587d4384ae9 (diff)
Btrfs: add btrfs-debug-tree -b <block number> to print a single block
Diffstat (limited to 'print-tree.c')
-rw-r--r--print-tree.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/print-tree.c b/print-tree.c
index 59f43588..bd8af132 100644
--- a/print-tree.c
+++ b/print-tree.c
@@ -607,7 +607,7 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
}
}
-void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *eb)
+void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *eb, int follow)
{
int i;
u32 nr;
@@ -643,6 +643,9 @@ void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *eb)
(unsigned long long)btrfs_node_ptr_generation(eb, i));
fflush(stdout);
}
+ if (!follow)
+ return;
+
for (i = 0; i < nr; i++) {
struct extent_buffer *next = read_tree_block(root,
btrfs_node_blockptr(eb, i),
@@ -660,8 +663,7 @@ void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *eb)
if (btrfs_header_level(next) !=
btrfs_header_level(eb) - 1)
BUG();
- btrfs_print_tree(root, next);
+ btrfs_print_tree(root, next, 1);
free_extent_buffer(next);
}
}
-