]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: remove out label in btrfs_wait_for_commit()
authorFilipe Manana <fdmanana@suse.com>
Tue, 20 Jan 2026 20:07:32 +0000 (20:07 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Feb 2026 06:56:23 +0000 (07:56 +0100)
There is no point in having the label since all it does is return the
value in the 'ret' variable. Instead make every goto return directly
and remove the label.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.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/transaction.c

index f4cc9e1a1b93fa24e0cff65324286d213aef28f3..8aa55cd8a0bf8e31d644aa30bccc54e40fe66a08 100644 (file)
@@ -950,7 +950,7 @@ int btrfs_wait_for_commit(struct btrfs_fs_info *fs_info, u64 transid)
 
        if (transid) {
                if (transid <= btrfs_get_last_trans_committed(fs_info))
-                       goto out;
+                       return 0;
 
                /* find specified transaction */
                spin_lock(&fs_info->trans_lock);
@@ -975,7 +975,7 @@ int btrfs_wait_for_commit(struct btrfs_fs_info *fs_info, u64 transid)
                if (!cur_trans) {
                        if (transid > btrfs_get_last_trans_committed(fs_info))
                                ret = -EINVAL;
-                       goto out;
+                       return ret;
                }
        } else {
                /* find newest transaction that is committing | committed */
@@ -991,14 +991,15 @@ int btrfs_wait_for_commit(struct btrfs_fs_info *fs_info, u64 transid)
                        }
                }
                spin_unlock(&fs_info->trans_lock);
+               /* Nothing committing or committed. */
                if (!cur_trans)
-                       goto out;  /* nothing committing|committed */
+                       return ret;
        }
 
        wait_for_commit(cur_trans, TRANS_STATE_COMPLETED);
        ret = cur_trans->aborted;
        btrfs_put_transaction(cur_trans);
-out:
+
        return ret;
 }