diff options
author | Josef Bacik <josef@toxicpanda.com> | 2019-06-18 23:09:26 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-07-02 13:30:53 +0300 |
commit | 83d731a5b228454d7c29ec64fdd93426698f97f6 (patch) | |
tree | 46d6f8c6b03bf0e32992517180ad566d64d1a2db /fs/btrfs/space-info.c | |
parent | 0d9764f6d0fb9dd4d4b773b481f259c0567870c2 (diff) | |
download | linux-83d731a5b228454d7c29ec64fdd93426698f97f6.tar.xz |
btrfs: unexport can_overcommit
Now that we've moved all of the users to space-info.c, unexport it and
name it back to can_overcommit.
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/space-info.c')
-rw-r--r-- | fs/btrfs/space-info.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c index 1ac58d7e7790..ce33b1addf55 100644 --- a/fs/btrfs/space-info.c +++ b/fs/btrfs/space-info.c @@ -182,10 +182,10 @@ static inline u64 calc_global_rsv_need_space(struct btrfs_block_rsv *global) return (global->size << 1); } -int btrfs_can_overcommit(struct btrfs_fs_info *fs_info, - struct btrfs_space_info *space_info, u64 bytes, - enum btrfs_reserve_flush_enum flush, - bool system_chunk) +static int can_overcommit(struct btrfs_fs_info *fs_info, + struct btrfs_space_info *space_info, u64 bytes, + enum btrfs_reserve_flush_enum flush, + bool system_chunk) { struct btrfs_block_rsv *global_rsv = &fs_info->global_block_rsv; u64 profile; @@ -279,8 +279,7 @@ again: * adding the ticket space would be a double count. */ if (check_overcommit && - !btrfs_can_overcommit(fs_info, space_info, 0, flush, - false)) + !can_overcommit(fs_info, space_info, 0, flush, false)) break; if (num_bytes >= ticket->bytes) { list_del_init(&ticket->list); @@ -724,14 +723,14 @@ btrfs_calc_reclaim_metadata_size(struct btrfs_fs_info *fs_info, return to_reclaim; to_reclaim = min_t(u64, num_online_cpus() * SZ_1M, SZ_16M); - if (btrfs_can_overcommit(fs_info, space_info, to_reclaim, - BTRFS_RESERVE_FLUSH_ALL, system_chunk)) + if (can_overcommit(fs_info, space_info, to_reclaim, + BTRFS_RESERVE_FLUSH_ALL, system_chunk)) return 0; used = btrfs_space_info_used(space_info, true); - if (btrfs_can_overcommit(fs_info, space_info, SZ_1M, - BTRFS_RESERVE_FLUSH_ALL, system_chunk)) + if (can_overcommit(fs_info, space_info, SZ_1M, + BTRFS_RESERVE_FLUSH_ALL, system_chunk)) expected = div_factor_fine(space_info->total_bytes, 95); else expected = div_factor_fine(space_info->total_bytes, 90); @@ -978,8 +977,8 @@ static int __reserve_metadata_bytes(struct btrfs_fs_info *fs_info, trace_btrfs_space_reservation(fs_info, "space_info", space_info->flags, orig_bytes, 1); ret = 0; - } else if (btrfs_can_overcommit(fs_info, space_info, orig_bytes, flush, - system_chunk)) { + } else if (can_overcommit(fs_info, space_info, orig_bytes, flush, + system_chunk)) { btrfs_space_info_update_bytes_may_use(fs_info, space_info, orig_bytes); trace_btrfs_space_reservation(fs_info, "space_info", |