Skip to content

Commit c4d3008

Browse files
fdmananakdave
authored andcommitted
btrfs: pass boolean literals as the last argument to inc_block_group_ro()
The last argument of inc_block_group_ro() is defined as a boolean, but every caller is passing an integer literal, 0 or 1 for false and true respectively. While this is not incorrect, as 0 and 1 are converted to false and true, it's less readable and somewhat awkward since the argument is defined as boolean. Replace 0 and 1 with false and true. Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 1ba19a6 commit c4d3008

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

fs/btrfs/block-group.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,7 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info)
16791679
spin_unlock(&space_info->lock);
16801680

16811681
/* We don't want to force the issue, only flip if it's ok. */
1682-
ret = inc_block_group_ro(block_group, 0);
1682+
ret = inc_block_group_ro(block_group, false);
16831683
up_write(&space_info->groups_sem);
16841684
if (ret < 0) {
16851685
ret = 0;
@@ -2009,7 +2009,7 @@ void btrfs_reclaim_bgs_work(struct work_struct *work)
20092009
goto next;
20102010
}
20112011

2012-
ret = inc_block_group_ro(bg, 0);
2012+
ret = inc_block_group_ro(bg, false);
20132013
up_write(&space_info->groups_sem);
20142014
if (ret < 0)
20152015
goto next;
@@ -2538,7 +2538,7 @@ static int read_one_block_group(struct btrfs_fs_info *info,
25382538
btrfs_mark_bg_unused(cache);
25392539
}
25402540
} else {
2541-
inc_block_group_ro(cache, 1);
2541+
inc_block_group_ro(cache, true);
25422542
}
25432543

25442544
return 0;
@@ -2694,11 +2694,11 @@ int btrfs_read_block_groups(struct btrfs_fs_info *info)
26942694
list_for_each_entry(cache,
26952695
&space_info->block_groups[BTRFS_RAID_RAID0],
26962696
list)
2697-
inc_block_group_ro(cache, 1);
2697+
inc_block_group_ro(cache, true);
26982698
list_for_each_entry(cache,
26992699
&space_info->block_groups[BTRFS_RAID_SINGLE],
27002700
list)
2701-
inc_block_group_ro(cache, 1);
2701+
inc_block_group_ro(cache, true);
27022702
}
27032703

27042704
btrfs_init_global_block_rsv(info);
@@ -3087,7 +3087,7 @@ int btrfs_inc_block_group_ro(struct btrfs_block_group *cache,
30873087
*/
30883088
if (sb_rdonly(fs_info->sb)) {
30893089
mutex_lock(&fs_info->ro_block_group_mutex);
3090-
ret = inc_block_group_ro(cache, 0);
3090+
ret = inc_block_group_ro(cache, false);
30913091
mutex_unlock(&fs_info->ro_block_group_mutex);
30923092
return ret;
30933093
}
@@ -3138,7 +3138,7 @@ int btrfs_inc_block_group_ro(struct btrfs_block_group *cache,
31383138
}
31393139
}
31403140

3141-
ret = inc_block_group_ro(cache, 0);
3141+
ret = inc_block_group_ro(cache, false);
31423142
if (!ret)
31433143
goto out;
31443144
if (ret == -ETXTBSY)
@@ -3165,7 +3165,7 @@ int btrfs_inc_block_group_ro(struct btrfs_block_group *cache,
31653165
if (ret < 0)
31663166
goto out;
31673167

3168-
ret = inc_block_group_ro(cache, 0);
3168+
ret = inc_block_group_ro(cache, false);
31693169
if (ret == -ETXTBSY)
31703170
goto unlock_out;
31713171
out:

0 commit comments

Comments
 (0)