path: root/btrfs-calc-size.c
diff options
authorQu Wenruo <>2015-01-28 10:12:55 +0800
committerDavid Sterba <>2015-02-02 19:21:24 +0100
commitccdd0a067f36b689a0928074d53e5020f3ff5f5d (patch)
treef06f2dcf7788ab6a3b1e698c1c1b13e15d0b75b3 /btrfs-calc-size.c
parent3e7524911214c4399f25ed2dabc0ad2956f7e90e (diff)
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 <>
Diffstat (limited to 'btrfs-calc-size.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/btrfs-calc-size.c b/btrfs-calc-size.c
index 800ceb60..13720845 100644
--- a/btrfs-calc-size.c
+++ b/btrfs-calc-size.c
@@ -156,7 +156,7 @@ static int walk_nodes(struct btrfs_root *root, struct btrfs_path *path,
tmp = read_tree_block(root, cur_blocknr,
btrfs_level_size(root, level - 1),
btrfs_node_ptr_generation(b, i));
- if (!tmp) {
+ if (!extent_buffer_uptodate(tmp)) {
fprintf(stderr, "Failed to read blocknr %Lu\n",
btrfs_node_blockptr(b, i));