diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/extent-tree.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 2846cebc9427..aca3314ef8b9 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -3000,8 +3000,7 @@ static void force_metadata_allocation(struct btrfs_fs_info *info) | |||
3000 | rcu_read_unlock(); | 3000 | rcu_read_unlock(); |
3001 | } | 3001 | } |
3002 | 3002 | ||
3003 | static int should_alloc_chunk(struct btrfs_space_info *sinfo, | 3003 | static int should_alloc_chunk(struct btrfs_space_info *sinfo, u64 alloc_bytes) |
3004 | u64 alloc_bytes) | ||
3005 | { | 3004 | { |
3006 | u64 num_bytes = sinfo->total_bytes - sinfo->bytes_readonly; | 3005 | u64 num_bytes = sinfo->total_bytes - sinfo->bytes_readonly; |
3007 | 3006 | ||
@@ -3013,6 +3012,10 @@ static int should_alloc_chunk(struct btrfs_space_info *sinfo, | |||
3013 | alloc_bytes < div_factor(num_bytes, 8)) | 3012 | alloc_bytes < div_factor(num_bytes, 8)) |
3014 | return 0; | 3013 | return 0; |
3015 | 3014 | ||
3015 | if (num_bytes > 256 * 1024 * 1024 && | ||
3016 | sinfo->bytes_used < div_factor(num_bytes, 3)) | ||
3017 | return 0; | ||
3018 | |||
3016 | return 1; | 3019 | return 1; |
3017 | } | 3020 | } |
3018 | 3021 | ||