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 <johannes.thumshirn@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Filipe Manana
2026-02-02 16:50:18 +00:00
committed by David Sterba
parent 1ba19a6ea9
commit c4d30088fa

View File

@@ -1679,7 +1679,7 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info)
spin_unlock(&space_info->lock);
/* We don't want to force the issue, only flip if it's ok. */
ret = inc_block_group_ro(block_group, 0);
ret = inc_block_group_ro(block_group, false);
up_write(&space_info->groups_sem);
if (ret < 0) {
ret = 0;
@@ -2009,7 +2009,7 @@ void btrfs_reclaim_bgs_work(struct work_struct *work)
goto next;
}
ret = inc_block_group_ro(bg, 0);
ret = inc_block_group_ro(bg, false);
up_write(&space_info->groups_sem);
if (ret < 0)
goto next;
@@ -2538,7 +2538,7 @@ static int read_one_block_group(struct btrfs_fs_info *info,
btrfs_mark_bg_unused(cache);
}
} else {
inc_block_group_ro(cache, 1);
inc_block_group_ro(cache, true);
}
return 0;
@@ -2694,11 +2694,11 @@ int btrfs_read_block_groups(struct btrfs_fs_info *info)
list_for_each_entry(cache,
&space_info->block_groups[BTRFS_RAID_RAID0],
list)
inc_block_group_ro(cache, 1);
inc_block_group_ro(cache, true);
list_for_each_entry(cache,
&space_info->block_groups[BTRFS_RAID_SINGLE],
list)
inc_block_group_ro(cache, 1);
inc_block_group_ro(cache, true);
}
btrfs_init_global_block_rsv(info);
@@ -3087,7 +3087,7 @@ int btrfs_inc_block_group_ro(struct btrfs_block_group *cache,
*/
if (sb_rdonly(fs_info->sb)) {
mutex_lock(&fs_info->ro_block_group_mutex);
ret = inc_block_group_ro(cache, 0);
ret = inc_block_group_ro(cache, false);
mutex_unlock(&fs_info->ro_block_group_mutex);
return ret;
}
@@ -3138,7 +3138,7 @@ int btrfs_inc_block_group_ro(struct btrfs_block_group *cache,
}
}
ret = inc_block_group_ro(cache, 0);
ret = inc_block_group_ro(cache, false);
if (!ret)
goto out;
if (ret == -ETXTBSY)
@@ -3165,7 +3165,7 @@ int btrfs_inc_block_group_ro(struct btrfs_block_group *cache,
if (ret < 0)
goto out;
ret = inc_block_group_ro(cache, 0);
ret = inc_block_group_ro(cache, false);
if (ret == -ETXTBSY)
goto unlock_out;
out: