diff options
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a0ca2b5914d0..9ef8f99d5a2a 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -4936,7 +4936,7 @@ btrfs_calc_reclaim_metadata_size(struct btrfs_root *root, | |||
4936 | } | 4936 | } |
4937 | 4937 | ||
4938 | static inline int need_do_async_reclaim(struct btrfs_space_info *space_info, | 4938 | static inline int need_do_async_reclaim(struct btrfs_space_info *space_info, |
4939 | struct btrfs_fs_info *fs_info, u64 used) | 4939 | struct btrfs_root *root, u64 used) |
4940 | { | 4940 | { |
4941 | u64 thresh = div_factor_fine(space_info->total_bytes, 98); | 4941 | u64 thresh = div_factor_fine(space_info->total_bytes, 98); |
4942 | 4942 | ||
@@ -4944,11 +4944,12 @@ static inline int need_do_async_reclaim(struct btrfs_space_info *space_info, | |||
4944 | if ((space_info->bytes_used + space_info->bytes_reserved) >= thresh) | 4944 | if ((space_info->bytes_used + space_info->bytes_reserved) >= thresh) |
4945 | return 0; | 4945 | return 0; |
4946 | 4946 | ||
4947 | if (!btrfs_calc_reclaim_metadata_size(fs_info->fs_root, space_info)) | 4947 | if (!btrfs_calc_reclaim_metadata_size(root, space_info)) |
4948 | return 0; | 4948 | return 0; |
4949 | 4949 | ||
4950 | return (used >= thresh && !btrfs_fs_closing(fs_info) && | 4950 | return (used >= thresh && !btrfs_fs_closing(root->fs_info) && |
4951 | !test_bit(BTRFS_FS_STATE_REMOUNTING, &fs_info->fs_state)); | 4951 | !test_bit(BTRFS_FS_STATE_REMOUNTING, |
4952 | &root->fs_info->fs_state)); | ||
4952 | } | 4953 | } |
4953 | 4954 | ||
4954 | static void wake_all_tickets(struct list_head *head) | 4955 | static void wake_all_tickets(struct list_head *head) |
@@ -5193,7 +5194,7 @@ static int __reserve_metadata_bytes(struct btrfs_root *root, | |||
5193 | * the async reclaim as we will panic. | 5194 | * the async reclaim as we will panic. |
5194 | */ | 5195 | */ |
5195 | if (!root->fs_info->log_root_recovering && | 5196 | if (!root->fs_info->log_root_recovering && |
5196 | need_do_async_reclaim(space_info, root->fs_info, used) && | 5197 | need_do_async_reclaim(space_info, root, used) && |
5197 | !work_busy(&root->fs_info->async_reclaim_work)) { | 5198 | !work_busy(&root->fs_info->async_reclaim_work)) { |
5198 | trace_btrfs_trigger_flush(root->fs_info, | 5199 | trace_btrfs_trigger_flush(root->fs_info, |
5199 | space_info->flags, | 5200 | space_info->flags, |