Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 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>

authored by

Filipe Manana and committed by
David Sterba
271cbe76 c7d1d4ff

+1 -3
+1 -3
fs/btrfs/extent-tree.c
··· 1780 1780 node->type == BTRFS_SHARED_DATA_REF_KEY) { 1781 1781 ret = run_delayed_data_ref(trans, href, node, extent_op, 1782 1782 insert_reserved); 1783 - } else if (node->type == BTRFS_EXTENT_OWNER_REF_KEY) { 1784 - ret = 0; 1785 - } else { 1783 + } else if (unlikely(node->type != BTRFS_EXTENT_OWNER_REF_KEY)) { 1786 1784 ret = -EUCLEAN; 1787 1785 btrfs_err(fs_info, "unexpected delayed ref node type: %u", node->type); 1788 1786 }