Skip to content

Commit

Permalink
btrfs: remove list emptiness check at warn_about_uncommitted_trans()
Browse files Browse the repository at this point in the history
At warn_about_uncommitted_trans(), there's no need to check if the list
is empty and return, because list_for_each_entry_safe() is safe to call
for an empty list, it simply does nothing. So remove the check.

Reviewed-by: Qu Wenruo <[email protected]>
Signed-off-by: Filipe Manana <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
fdmanana authored and kdave committed Apr 4, 2024
1 parent 785d9c3 commit acf9857
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -4182,9 +4182,6 @@ static void warn_about_uncommitted_trans(struct btrfs_fs_info *fs_info)
struct btrfs_transaction *tmp;
bool found = false;

if (list_empty(&fs_info->trans_list))
return;

/*
* This function is only called at the very end of close_ctree(),
* thus no other running transaction, no need to take trans_lock.
Expand Down

0 comments on commit acf9857

Please sign in to comment.