Skip to content

Commit 6cb7f0b

Browse files
fdmananakdave
authored andcommitted
btrfs: use level argument in log tree walk callback replay_one_buffer()
We already have the extent buffer's level in an argument, there's no need to first ensure the extent buffer's data is loaded (by calling btrfs_read_extent_buffer()) and then call btrfs_header_level() to check the level. So use the level argument and do the check before calling btrfs_read_extent_buffer(). Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent c2ef817 commit 6cb7f0b

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

fs/btrfs/tree-log.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2591,17 +2591,15 @@ static int replay_one_buffer(struct extent_buffer *eb,
25912591
int i;
25922592
int ret;
25932593

2594+
if (level != 0)
2595+
return 0;
2596+
25942597
ret = btrfs_read_extent_buffer(eb, &check);
25952598
if (ret) {
25962599
btrfs_abort_transaction(trans, ret);
25972600
return ret;
25982601
}
25992602

2600-
level = btrfs_header_level(eb);
2601-
2602-
if (level != 0)
2603-
return 0;
2604-
26052603
path = btrfs_alloc_path();
26062604
if (!path) {
26072605
btrfs_abort_transaction(trans, -ENOMEM);

0 commit comments

Comments
 (0)