forked from Mirrors/btrfs-progs
btrfs-progs: Move btrfs_num_copies() call out of the loop in read_tree_block()
btrfs_num_copies really only needs to be called once, so move it out of the verification loop in read_tree_block(). Signed-off-by: Qu Wenruo <wqu@suse.com>master
parent
e8ae577030
commit
f76136a8d0
|
@ -349,6 +349,7 @@ struct extent_buffer* read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
|
|||
if (btrfs_buffer_uptodate(eb, parent_transid))
|
||||
return eb;
|
||||
|
||||
num_copies = btrfs_num_copies(fs_info, eb->start, eb->len);
|
||||
while (1) {
|
||||
ret = read_whole_eb(fs_info, eb, mirror_num);
|
||||
if (ret == 0 && csum_tree_block(fs_info, eb, 1) == 0 &&
|
||||
|
@ -376,7 +377,6 @@ struct extent_buffer* read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
|
|||
ret = -EIO;
|
||||
break;
|
||||
}
|
||||
num_copies = btrfs_num_copies(fs_info, eb->start, eb->len);
|
||||
if (num_copies == 1) {
|
||||
ignore = 1;
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue