From 3f8982543dae28159cec5fad33c1b3f5cd12314b Mon Sep 17 00:00:00 2001 From: Filipe Manana Date: Tue, 20 Jan 2026 20:07:32 +0000 Subject: [PATCH] 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 Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/transaction.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index f4cc9e1a1b93f..8aa55cd8a0bf8 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -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; } -- 2.47.3