diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/free-space-cache.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index f631df870f64..63776ae72f9e 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c | |||
@@ -1910,8 +1910,8 @@ static int btrfs_bitmap_cluster(struct btrfs_block_group_cache *block_group, | |||
1910 | 1910 | ||
1911 | i = offset_to_bit(entry->offset, block_group->sectorsize, | 1911 | i = offset_to_bit(entry->offset, block_group->sectorsize, |
1912 | max_t(u64, offset, entry->offset)); | 1912 | max_t(u64, offset, entry->offset)); |
1913 | search_bits = bytes_to_bits(min_bytes, block_group->sectorsize); | 1913 | search_bits = bytes_to_bits(bytes, block_group->sectorsize); |
1914 | total_bits = bytes_to_bits(bytes, block_group->sectorsize); | 1914 | total_bits = bytes_to_bits(min_bytes, block_group->sectorsize); |
1915 | 1915 | ||
1916 | again: | 1916 | again: |
1917 | found_bits = 0; | 1917 | found_bits = 0; |
@@ -2034,8 +2034,7 @@ again: | |||
2034 | 2034 | ||
2035 | if (entry->bitmap && entry->bytes > bytes + empty_size) { | 2035 | if (entry->bitmap && entry->bytes > bytes + empty_size) { |
2036 | ret = btrfs_bitmap_cluster(block_group, entry, cluster, | 2036 | ret = btrfs_bitmap_cluster(block_group, entry, cluster, |
2037 | offset, bytes + empty_size, | 2037 | offset, bytes, min_bytes); |
2038 | min_bytes); | ||
2039 | if (!ret) | 2038 | if (!ret) |
2040 | goto got_it; | 2039 | goto got_it; |
2041 | } | 2040 | } |
@@ -2065,7 +2064,7 @@ again: | |||
2065 | 2064 | ||
2066 | while (1) { | 2065 | while (1) { |
2067 | /* out window is just right, lets fill it */ | 2066 | /* out window is just right, lets fill it */ |
2068 | if (window_free >= bytes + empty_size) | 2067 | if (window_free >= min_bytes) |
2069 | break; | 2068 | break; |
2070 | 2069 | ||
2071 | node = rb_next(&last->offset_index); | 2070 | node = rb_next(&last->offset_index); |