]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: remove pointless out label in qgroup_account_snapshot()
authorFilipe Manana <fdmanana@suse.com>
Tue, 10 Feb 2026 12:08:56 +0000 (12:08 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Apr 2026 16:55:56 +0000 (18:55 +0200)
The 'out' label is pointless as there are no cleanups to perform there,
we can replace every goto with a direct return.

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/transaction.c

index 77249dcbd7b4a08b51cbdbb49b8c035c7f534ab9..2df80452b0b74031baa1e7d495076d4c6c4e0bca 100644 (file)
@@ -1602,16 +1602,16 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans,
 
        ret = commit_fs_roots(trans);
        if (ret)
-               goto out;
+               return ret;
        ret = btrfs_qgroup_account_extents(trans);
        if (ret < 0)
-               goto out;
+               return ret;
 
        /* Now qgroup are all updated, we can inherit it to new qgroups */
        ret = btrfs_qgroup_inherit(trans, btrfs_root_id(src), dst_objectid,
                                   btrfs_root_id(parent), inherit);
        if (ret < 0)
-               goto out;
+               return ret;
 
        /*
         * Now we do a simplified commit transaction, which will:
@@ -1627,23 +1627,22 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans,
         */
        ret = commit_cowonly_roots(trans);
        if (ret)
-               goto out;
+               return ret;
        switch_commit_roots(trans);
        ret = btrfs_write_and_wait_transaction(trans);
-       if (unlikely(ret))
+       if (unlikely(ret)) {
                btrfs_err(fs_info,
 "error while writing out transaction during qgroup snapshot accounting: %d", ret);
+               return ret;
+       }
 
-out:
        /*
         * Force parent root to be updated, as we recorded it before so its
         * last_trans == cur_transid.
         * Or it won't be committed again onto disk after later
         * insert_dir_item()
         */
-       if (!ret)
-               ret = record_root_in_trans(trans, parent, 1);
-       return ret;
+       return record_root_in_trans(trans, parent, 1);
 }
 
 /*