summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2026-02-02 16:50:18 +0000
committerDavid Sterba <dsterba@suse.com>2026-04-07 18:55:52 +0200
commitc4d30088fa28289aaf05ab421864ef8573ba9717 (patch)
tree0b828293eaeaf65a620f9bab9812cb24aeb3ae9c
parent1ba19a6ea9f27ea383560d3ead6d8f5b773aff33 (diff)
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>
-rw-r--r--fs/btrfs/block-group.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index c0d17a369bda..a021a6dab8f9 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -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: