mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
btrfs: make btrfs_can_overcommit() return bool instead of int
It's a boolean function, so switch its return type to 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>
This commit is contained in:
parent
60532c2136
commit
563ef2befb
|
|
@ -490,22 +490,20 @@ static u64 calc_available_free_space(const struct btrfs_space_info *space_info,
|
|||
return avail;
|
||||
}
|
||||
|
||||
int btrfs_can_overcommit(const struct btrfs_space_info *space_info, u64 bytes,
|
||||
enum btrfs_reserve_flush_enum flush)
|
||||
bool btrfs_can_overcommit(const struct btrfs_space_info *space_info, u64 bytes,
|
||||
enum btrfs_reserve_flush_enum flush)
|
||||
{
|
||||
u64 avail;
|
||||
u64 used;
|
||||
|
||||
/* Don't overcommit when in mixed mode */
|
||||
if (space_info->flags & BTRFS_BLOCK_GROUP_DATA)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
used = btrfs_space_info_used(space_info, true);
|
||||
avail = calc_available_free_space(space_info, flush);
|
||||
|
||||
if (used + bytes < space_info->total_bytes + avail)
|
||||
return 1;
|
||||
return 0;
|
||||
return (used + bytes < space_info->total_bytes + avail);
|
||||
}
|
||||
|
||||
static void remove_ticket(struct btrfs_space_info *space_info,
|
||||
|
|
|
|||
|
|
@ -282,8 +282,8 @@ int btrfs_reserve_metadata_bytes(struct btrfs_space_info *space_info,
|
|||
u64 orig_bytes,
|
||||
enum btrfs_reserve_flush_enum flush);
|
||||
void btrfs_try_granting_tickets(struct btrfs_space_info *space_info);
|
||||
int btrfs_can_overcommit(const struct btrfs_space_info *space_info, u64 bytes,
|
||||
enum btrfs_reserve_flush_enum flush);
|
||||
bool btrfs_can_overcommit(const struct btrfs_space_info *space_info, u64 bytes,
|
||||
enum btrfs_reserve_flush_enum flush);
|
||||
|
||||
static inline void btrfs_space_info_free_bytes_may_use(
|
||||
struct btrfs_space_info *space_info,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user