summaryrefslogtreecommitdiff
path: root/backref.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2015-01-28 10:12:55 +0800
committerDavid Sterba <dsterba@suse.cz>2015-02-02 19:21:24 +0100
commitccdd0a067f36b689a0928074d53e5020f3ff5f5d (patch)
treef06f2dcf7788ab6a3b1e698c1c1b13e15d0b75b3 /backref.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 <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'backref.c')
-rw-r--r--backref.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/backref.c b/backref.c
index 593f9363..9a2efca2 100644
--- a/backref.c
+++ b/backref.c
@@ -451,7 +451,7 @@ static int __add_missing_keys(struct btrfs_fs_info *fs_info,
BUG_ON(!ref->wanted_disk_byte);
eb = read_tree_block(fs_info->tree_root, ref->wanted_disk_byte,
fs_info->tree_root->leafsize, 0);
- if (!eb || !extent_buffer_uptodate(eb)) {
+ if (!extent_buffer_uptodate(eb)) {
free_extent_buffer(eb);
return -EIO;
}
@@ -808,7 +808,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
ref->level);
eb = read_tree_block(fs_info->extent_root,
ref->parent, bsz, 0);
- if (!eb || !extent_buffer_uptodate(eb)) {
+ if (!extent_buffer_uptodate(eb)) {
free_extent_buffer(eb);
ret = -EIO;
goto out;