]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: assign booleans to global reserve's full field
authorFilipe Manana <fdmanana@suse.com>
Fri, 17 Oct 2025 16:30:38 +0000 (17:30 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 21:12:07 +0000 (22:12 +0100)
We have a couple places that are assigning 0 and 1 to the full field of
the global reserve. This is harmless since 0 is converted to false and
1 converted to true, but for better readability, replace these with true
and false since the field is of type bool.

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/space-info.c

index a2af55178c694354363e0d73d64f3134af575bca..62e1ba7f09c0a69f157d0c37175c115604564ae9 100644 (file)
@@ -1067,7 +1067,7 @@ static bool steal_from_global_rsv(struct btrfs_space_info *space_info,
        wake_up(&ticket->wait);
        space_info->tickets_id++;
        if (global_rsv->reserved < global_rsv->size)
-               global_rsv->full = 0;
+               global_rsv->full = false;
        spin_unlock(&global_rsv->lock);
 
        return true;
@@ -2186,7 +2186,7 @@ void btrfs_return_free_space(struct btrfs_space_info *space_info, u64 len)
                global_rsv->reserved += to_add;
                btrfs_space_info_update_bytes_may_use(space_info, to_add);
                if (global_rsv->reserved >= global_rsv->size)
-                       global_rsv->full = 1;
+                       global_rsv->full = true;
                len -= to_add;
        }
        spin_unlock(&global_rsv->lock);