diff options
author | Chris Mason <clm@fb.com> | 2016-09-02 03:29:34 +0300 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2016-09-02 03:29:34 +0300 |
commit | cb887083d084d74421ae7bb18acca40568da791f (patch) | |
tree | 0b8cc1019a229ceea587b72c29811d1d72b22879 /fs/btrfs/extent-tree.c | |
parent | 28a235931b56d4e7bdd51f6733daf95f2b269da8 (diff) | |
parent | e0af24849efb0eea572cf22d22bb65d164cb8a6f (diff) | |
download | linux-cb887083d084d74421ae7bb18acca40568da791f.tar.xz |
Merge tag 'for-chris' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.8
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 60d4ae7ce974..64676a16d32a 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4901,11 +4901,6 @@ btrfs_calc_reclaim_metadata_size(struct btrfs_root *root, u64 expected; u64 to_reclaim = 0; - to_reclaim = min_t(u64, num_online_cpus() * SZ_1M, SZ_16M); - if (can_overcommit(root, space_info, to_reclaim, - BTRFS_RESERVE_FLUSH_ALL)) - return 0; - list_for_each_entry(ticket, &space_info->tickets, list) to_reclaim += ticket->bytes; list_for_each_entry(ticket, &space_info->priority_tickets, list) @@ -4913,6 +4908,11 @@ btrfs_calc_reclaim_metadata_size(struct btrfs_root *root, if (to_reclaim) return to_reclaim; + to_reclaim = min_t(u64, num_online_cpus() * SZ_1M, SZ_16M); + if (can_overcommit(root, space_info, to_reclaim, + BTRFS_RESERVE_FLUSH_ALL)) + return 0; + used = space_info->bytes_used + space_info->bytes_reserved + space_info->bytes_pinned + space_info->bytes_readonly + space_info->bytes_may_use; |