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 --- cmds-check.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmds-check.c') diff --git a/cmds-check.c b/cmds-check.c index 15e4495..73d7866 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -1756,7 +1756,7 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path, reada_walk_down(root, cur, path->slots[*level]); next = read_tree_block(root, bytenr, blocksize, ptr_gen); - if (!next) { + if (!extent_buffer_uptodate(next)) { struct btrfs_key node_key; btrfs_node_key_to_cpu(path->nodes[*level], @@ -8038,7 +8038,7 @@ static int pin_down_tree_blocks(struct btrfs_fs_info *fs_info, */ tmp = read_tree_block(fs_info->extent_root, bytenr, leafsize, 0); - if (!tmp) { + if (!extent_buffer_uptodate(tmp)) { fprintf(stderr, "Error reading root block\n"); return -EIO; } @@ -8057,7 +8057,7 @@ static int pin_down_tree_blocks(struct btrfs_fs_info *fs_info, tmp = read_tree_block(fs_info->extent_root, bytenr, leafsize, 0); - if (!tmp) { + if (!extent_buffer_uptodate(tmp)) { fprintf(stderr, "Error reading tree block\n"); return -EIO; } -- cgit v1.2.1