]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Simplify math in should_alloc chunk
authorNikolay Borisov <nborisov@suse.com>
Thu, 22 Jun 2017 13:51:48 +0000 (09:51 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 16 Aug 2017 14:12:05 +0000 (16:12 +0200)
commit275becbcf79765b5110f2b2a13e7d5edfbb2a29c
tree480aa86869881eb7164a1a5b36c7d62276cd438d
parenta5392ff23227d7f141da40d6af6d8dea8489f4f6
btrfs: Simplify math in should_alloc chunk

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: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c