From: Filipe Manana Date: Mon, 2 Feb 2026 16:50:18 +0000 (+0000) Subject: btrfs: pass boolean literals as the last argument to inc_block_group_ro() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c4d30088fa28289aaf05ab421864ef8573ba9717;p=thirdparty%2Flinux.git 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 Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- 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: