Commit 271cbe76 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba
Browse files

btrfs: remove unnecessary else branch in run_one_delayed_ref()



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: default avatarBoris Burkov <boris@bur.io>
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent c7d1d4ff
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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);
	}