btrfs: remove out label in btrfs_wait_for_commit()

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>
This commit is contained in:
Filipe Manana 2026-01-20 20:07:32 +00:00 committed by David Sterba
parent 5eb01bf4a9
commit 3f8982543d

View 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;
}