Skip to content

Commit

Permalink
btrfs: remove unnecessary leaf check at btrfs_tree_mod_log_free_eb()
Browse files Browse the repository at this point in the history
At btrfs_tree_mod_log_free_eb() we check if we are dealing with a leaf,
and if so, return immediately and do nothing. However this check can be
removed, because after it we call tree_mod_need_log(), which returns
false when given an extent buffer that corresponds to a leaf.

So just remove the leaf check and pass the extent buffer to
tree_mod_need_log().

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Filipe Manana authored and David Sterba committed Apr 19, 2021
1 parent 888dd18 commit ffe1d03
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/btrfs/tree-mod-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,7 @@ int btrfs_tree_mod_log_free_eb(struct extent_buffer *eb)
int i;
int ret = 0;

if (btrfs_header_level(eb) == 0)
return 0;

if (!tree_mod_need_log(eb->fs_info, NULL))
if (!tree_mod_need_log(eb->fs_info, eb))
return 0;

nritems = btrfs_header_nritems(eb);
Expand Down

0 comments on commit ffe1d03

Please sign in to comment.