aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2025-08-28 17:46:18 +0100
committerDavid Sterba <dsterba@suse.com>2025-09-23 08:49:19 +0200
commit6cb7f0b8c9b0d6a35682335fea88bd26f089306f (patch)
tree79700b7bdce30839bb960ba3524a7f66af26567a /fs/btrfs/tree-log.c
parentbtrfs: use level argument in log tree walk callback process_one_buffer() (diff)
downloadwireguard-linux-6cb7f0b8c9b0d6a35682335fea88bd26f089306f.tar.xz
wireguard-linux-6cb7f0b8c9b0d6a35682335fea88bd26f089306f.zip
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>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 166ceb003a1e..88e813bb28d8 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -2591,17 +2591,15 @@ static int replay_one_buffer(struct extent_buffer *eb,
int i;
int ret;
+ if (level != 0)
+ return 0;
+
ret = btrfs_read_extent_buffer(eb, &check);
if (ret) {
btrfs_abort_transaction(trans, ret);
return ret;
}
- level = btrfs_header_level(eb);
-
- if (level != 0)
- return 0;
-
path = btrfs_alloc_path();
if (!path) {
btrfs_abort_transaction(trans, -ENOMEM);