btrfs: simplify extent type checks in run_delalloc_nocow
authorNikolay Borisov <nborisov@suse.com>
Mon, 5 Aug 2019 14:47:05 +0000 (17:47 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:13 +0000 (14:59 +0200)
commitbb55f6260b4756ba0ce46fc373f6f2e1893f752d
tree775395039fe6a54979759f237e2f2e11711d371e
parenta6bd9cd1559b8e78d1d03fe64445ae6dc419ea16
btrfs: simplify extent type checks in run_delalloc_nocow

There is no point in checking the type of the extent again just to set
the 'type' variable, when this check has already been performed before.
Instead, extend the original if branch with an 'else' clause. This
allows to remove one local variable and make it obvious how the code
flow differs for prealloc/regular extents.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c