]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: remove unnecessary else branch in run_one_delayed_ref()
authorFilipe Manana <fdmanana@suse.com>
Tue, 13 Jan 2026 16:39:00 +0000 (16:39 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Feb 2026 06:51:43 +0000 (07:51 +0100)
There is no need for an else branch to deal with an unexpected delayed ref
type. We can just change the previous branch to deal with this by checking
if the ref type is not BTRFS_EXTENT_OWNER_REF_KEY, since that branch is
useless as it only sets 'ret' to zero when it's already zero. So merge the
two branches.

Reviewed-by: Boris Burkov <boris@bur.io>
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/extent-tree.c

index 57ffe9b3b954d3f793d930230cd7bf1da5b82fbe..b3a26b61f9373353800ad55c12939b4ff9f61a69 100644 (file)
@@ -1780,9 +1780,7 @@ static int run_one_delayed_ref(struct btrfs_trans_handle *trans,
                   node->type == BTRFS_SHARED_DATA_REF_KEY) {
                ret = run_delayed_data_ref(trans, href, node, extent_op,
                                           insert_reserved);
-       } else if (node->type == BTRFS_EXTENT_OWNER_REF_KEY) {
-               ret = 0;
-       } else {
+       } else if (unlikely(node->type != BTRFS_EXTENT_OWNER_REF_KEY)) {
                ret = -EUCLEAN;
                btrfs_err(fs_info, "unexpected delayed ref node type: %u", node->type);
        }