summaryrefslogtreecommitdiff
path: root/fs/btrfs/space-info.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/space-info.c')
-rw-r--r--fs/btrfs/space-info.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
index a2e14c410416..75e7fa337e66 100644
--- a/fs/btrfs/space-info.c
+++ b/fs/btrfs/space-info.c
@@ -553,21 +553,9 @@ static inline u64 calc_reclaim_items_nr(const struct btrfs_fs_info *fs_info,
static inline u64 calc_delayed_refs_nr(const struct btrfs_fs_info *fs_info,
u64 to_reclaim)
{
- u64 bytes;
+ const u64 bytes = btrfs_calc_delayed_ref_bytes(fs_info, 1);
u64 nr;
- bytes = btrfs_calc_insert_metadata_size(fs_info, 1);
- /*
- * We have to check the mount option here because we could be enabling
- * the free space tree for the first time and don't have the compat_ro
- * option set yet.
- *
- * We need extra reservations if we have the free space tree because
- * we'll have to modify that tree as well.
- */
- if (btrfs_test_opt(fs_info, FREE_SPACE_TREE))
- bytes *= 2;
-
nr = div64_u64(to_reclaim, bytes);
if (!nr)
nr = 1;