Skip to content

Commit 2f4097e

Browse files
fdmananagregkh
authored andcommitted
btrfs: use level argument in log tree walk callback replay_one_buffer()
[ Upstream commit 6cb7f0b8c9b0d6a35682335fea88bd26f089306f ] 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 <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent e3eec45 commit 2f4097e

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
@@ -2461,15 +2461,13 @@ static int replay_one_buffer(struct btrfs_root *log, struct extent_buffer *eb,
24612461
int i;
24622462
int ret;
24632463

2464+
if (level != 0)
2465+
return 0;
2466+
24642467
ret = btrfs_read_extent_buffer(eb, &check);
24652468
if (ret)
24662469
return ret;
24672470

2468-
level = btrfs_header_level(eb);
2469-
2470-
if (level != 0)
2471-
return 0;
2472-
24732471
path = btrfs_alloc_path();
24742472
if (!path)
24752473
return -ENOMEM;

0 commit comments

Comments
 (0)