]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: change 'reserved' argument from pin_down_extent() to bool
authorFilipe Manana <fdmanana@suse.com>
Mon, 20 Oct 2025 12:52:11 +0000 (13:52 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 21:16:14 +0000 (22:16 +0100)
It's used as a boolean, so convert it from int type to bool type.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c

index 21420dc26a50e072e34e50a680c2db7a77940faf..36963b4a6303f78523355e681db6e90a3da07152 100644 (file)
@@ -2592,7 +2592,7 @@ static u64 first_logical_byte(struct btrfs_fs_info *fs_info)
 
 static int pin_down_extent(struct btrfs_trans_handle *trans,
                           struct btrfs_block_group *bg,
-                          u64 bytenr, u64 num_bytes, int reserved)
+                          u64 bytenr, u64 num_bytes, bool reserved)
 {
        struct btrfs_space_info *space_info = bg->space_info;
        const u64 reserved_bytes = (reserved ? num_bytes : 0);
@@ -2618,7 +2618,7 @@ int btrfs_pin_extent(struct btrfs_trans_handle *trans, u64 bytenr, u64 num_bytes
        cache = btrfs_lookup_block_group(trans->fs_info, bytenr);
        BUG_ON(!cache); /* Logic error */
 
-       pin_down_extent(trans, cache, bytenr, num_bytes, 1);
+       pin_down_extent(trans, cache, bytenr, num_bytes, true);
 
        btrfs_put_block_group(cache);
        return 0;
@@ -2642,7 +2642,7 @@ int btrfs_pin_extent_for_log_replay(struct btrfs_trans_handle *trans,
        if (ret)
                goto out;
 
-       pin_down_extent(trans, cache, eb->start, eb->len, 0);
+       pin_down_extent(trans, cache, eb->start, eb->len, false);
 
        /* remove us from the free space cache (if we're there at all) */
        ret = btrfs_remove_free_space(cache, eb->start, eb->len);
@@ -3483,7 +3483,7 @@ int btrfs_free_tree_block(struct btrfs_trans_handle *trans,
        bg = btrfs_lookup_block_group(fs_info, buf->start);
 
        if (btrfs_header_flag(buf, BTRFS_HEADER_FLAG_WRITTEN)) {
-               pin_down_extent(trans, bg, buf->start, buf->len, 1);
+               pin_down_extent(trans, bg, buf->start, buf->len, true);
                btrfs_put_block_group(bg);
                goto out;
        }
@@ -3507,7 +3507,7 @@ int btrfs_free_tree_block(struct btrfs_trans_handle *trans,
 
        if (test_bit(BTRFS_FS_TREE_MOD_LOG_USERS, &fs_info->flags)
                     || btrfs_is_zoned(fs_info)) {
-               pin_down_extent(trans, bg, buf->start, buf->len, 1);
+               pin_down_extent(trans, bg, buf->start, buf->len, true);
                btrfs_put_block_group(bg);
                goto out;
        }
@@ -4775,7 +4775,7 @@ int btrfs_pin_reserved_extent(struct btrfs_trans_handle *trans,
                return -ENOSPC;
        }
 
-       ret = pin_down_extent(trans, cache, eb->start, eb->len, 1);
+       ret = pin_down_extent(trans, cache, eb->start, eb->len, true);
        btrfs_put_block_group(cache);
        return ret;
 }