btrfs: Streamline memory allocation failure handling in btrfs_add_delayed_tree_ref
authorNikolay Borisov <nborisov@suse.com>
Wed, 20 Jun 2018 15:43:12 +0000 (18:43 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:39 +0000 (13:12 +0200)
commit7b4284de93c51b1d78699bf06bccee892699aa4e
tree06a6eac388d3c188f0c17f4bf4bda39b52a55162
parent43794446548730ac8461be30bbe47d5d027d1d16
btrfs: Streamline memory allocation failure handling in btrfs_add_delayed_tree_ref

Currently the function uses 2 goto labels to properly handle allocation
failures. This could be simplified by simply re-arranging the code so
that allocations are the in the beginning of the function. This allows
to use simple return statements. No functional changes.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-ref.c