From ccdd0a067f36b689a0928074d53e5020f3ff5f5d Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Wed, 28 Jan 2015 10:12:55 +0800 Subject: btrfs-progs: read_tree_block() and read_node_slot() cleanup. Allow read_tree_block() and read_node_slot() to return error pointer. This should help caller to get more specified error number. For existing callers, change (!eb) judgmentt to (!extent_buffer_uptodate(eb)) to keep the compatibility, and for caller missing the check, use PTR_ERR(eb) if possible. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- print-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'print-tree.c') diff --git a/print-tree.c b/print-tree.c index 70a7acc6..3a7c13cd 100644 --- a/print-tree.c +++ b/print-tree.c @@ -1060,7 +1060,7 @@ void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *eb, int fol btrfs_node_blockptr(eb, i), size, btrfs_node_ptr_generation(eb, i)); - if (!next) { + if (!extent_buffer_uptodate(next)) { fprintf(stderr, "failed to read %llu in tree %llu\n", (unsigned long long)btrfs_node_blockptr(eb, i), (unsigned long long)btrfs_header_owner(eb)); -- cgit v1.2.3