diff options
author | Nikolay Borisov <nborisov@suse.com> | 2017-06-14 11:35:34 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-06-19 18:26:04 +0200 |
commit | 0eee8a494e786672c57d86c445e24e678d562bf4 (patch) | |
tree | 73c8cdd28b8b8804ac64f4e60b9f8f1d8c7ad2df /fs/btrfs/extent-tree.c | |
parent | 4fc6441aac75893b4f32415f693d001f290d7d5b (diff) |
btrfs: Use btrfs_space_info_used instead of opencoding it
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 4689b88ac408..65659bd55a4e 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4949,9 +4949,8 @@ btrfs_calc_reclaim_metadata_size(struct btrfs_fs_info *fs_info, BTRFS_RESERVE_FLUSH_ALL, system_chunk)) return 0; - used = space_info->bytes_used + space_info->bytes_reserved + - space_info->bytes_pinned + space_info->bytes_readonly + - space_info->bytes_may_use; + used = btrfs_space_info_used(space_info, true); + if (can_overcommit(fs_info, space_info, SZ_1M, BTRFS_RESERVE_FLUSH_ALL, system_chunk)) expected = div_factor_fine(space_info->total_bytes, 95); @@ -5398,9 +5397,7 @@ static void space_info_add_old_bytes(struct btrfs_fs_info *fs_info, * overcommit, and if we can't then we just need to free up our space * and not satisfy any requests. */ - used = space_info->bytes_used + space_info->bytes_reserved + - space_info->bytes_pinned + space_info->bytes_readonly + - space_info->bytes_may_use; + used = btrfs_space_info_used(space_info, true); if (used - num_bytes >= space_info->total_bytes) check_overcommit = true; again: |