btrfs: Simplify update of space_info in __reserve_metadata_bytes()
authorGoldwyn Rodrigues <rgoldwyn@suse.com>
Tue, 25 Jun 2019 18:11:31 +0000 (20:11 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 2 Jul 2019 10:30:53 +0000 (12:30 +0200)
commit9b4851bc48b9346a957a71ca355ecdb7f2759fb8
tree19dbfddad6b7158dd57f3cebddf028e7335a3687
parent83d731a5b228454d7c29ec64fdd93426698f97f6
btrfs: Simplify update of space_info in __reserve_metadata_bytes()

We don't need an if-else-if chain where we can use a simple OR since
both conditions are performing the same action. The short-circuit for OR
will ensure that if the first condition is true, can_overcommit() is not
called.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/space-info.c