]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
btrfs: remove list_empty() check at warn_about_uncommitted_trans()
authorFilipe Manana <fdmanana@suse.com>
Wed, 3 Apr 2024 11:38:21 +0000 (12:38 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 May 2024 19:31:03 +0000 (21:31 +0200)
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 <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c

index 5a35c2c0bbc94d2cbfcdc48345c211c0b07ee5ae..0474e9b6d3023dd40db28618be44441d4047ad09 100644 (file)
@@ -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.