summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Moise <00moses.alexander00@gmail.com>2015-09-09 00:18:50 (GMT)
committerDavid Sterba <dsterba@suse.com>2015-10-21 16:28:48 (GMT)
commite9cf439f0dc824cca6b2dc0dbb14e17f3f80b7f1 (patch)
treee60295b7c85131d23c0ead3ae3e89657fd28a01b
parenta099d0fdb34f00cee346703036a0a90d267e77d7 (diff)
downloadlinux-e9cf439f0dc824cca6b2dc0dbb14e17f3f80b7f1.tar.xz
btrfs: use a single if() statement for one outcome in get_block_rsv()
Rather than have three separate if() statements for the same outcome we should just OR them together in the same if() statement. Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: Alexandru Moise <00moses.alexander00@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/extent-tree.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 601d7d4..8a1759b 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4891,13 +4891,9 @@ static struct btrfs_block_rsv *get_block_rsv(
{
struct btrfs_block_rsv *block_rsv = NULL;
- if (test_bit(BTRFS_ROOT_REF_COWS, &root->state))
- block_rsv = trans->block_rsv;
-
- if (root == root->fs_info->csum_root && trans->adding_csums)
- block_rsv = trans->block_rsv;
-
- if (root == root->fs_info->uuid_root)
+ if (test_bit(BTRFS_ROOT_REF_COWS, &root->state) ||
+ (root == root->fs_info->csum_root && trans->adding_csums) ||
+ (root == root->fs_info->uuid_root))
block_rsv = trans->block_rsv;
if (!block_rsv)