• Josef Bacik's avatar
    Btrfs: deal with min_bytes appropriately when looking for a cluster · d0a365e8
    Josef Bacik authored
    We do all this fun stuff with min_bytes, but either don't use it in the case of
    just normal extents, or use it completely wrong in the case of bitmaps.  So fix
    this for both cases
    
    1) In the extent case, stop looking for space with window_free >= min_bytes
    instead of bytes + empty_size.
    
    2) In the bitmap case, we were looking for streches of free space that was at
    least min_bytes in size, which was not right at all.  So instead search for
    stretches of free space that are at least bytes in size (this will make a
    difference when we have > page size blocks) and then only search for min_bytes
    amount of free space.
    
    Thanks,
    Reviewed-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
    Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
    d0a365e8
free-space-cache.c 54.4 KB