Skip to content

Commit 90542dc

Browse files
fdmananagregkh
authored andcommitted
btrfs: use level argument in log tree walk callback replay_one_buffer()
[ Upstream commit 6cb7f0b ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 403eb8a commit 90542dc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

fs/btrfs/tree-log.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,15 +2443,13 @@ static int replay_one_buffer(struct btrfs_root *log, struct extent_buffer *eb,
24432443
int i;
24442444
int ret;
24452445

2446+
if (level != 0)
2447+
return 0;
2448+
24462449
ret = btrfs_read_extent_buffer(eb, &check);
24472450
if (ret)
24482451
return ret;
24492452

2450-
level = btrfs_header_level(eb);
2451-
2452-
if (level != 0)
2453-
return 0;
2454-
24552453
path = btrfs_alloc_path();
24562454
if (!path)
24572455
return -ENOMEM;

0 commit comments

Comments
 (0)