• Nikolay Borisov's avatar
    btrfs: Simplify math in should_alloc chunk · 8d8aafee
    Nikolay Borisov authored
    Currently should_alloc_chunk uses ->total_bytes - ->bytes_readonly to
    signify the total amount of bytes in this space info. However, given
    Jeff's patch which adds bytes_pinned and bytes_may_use to the calculation
    of num_allocated it becomes a lot more clear to just eliminate num_bytes
    altogether and add the bytes_readonly to the amount of used space. That
    way we don't change the results of the following statements. In the
    process also start using btrfs_space_info_used.
    Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
    Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    8d8aafee
extent-tree.c 300 KB