btrfs: use raid_attr for minimum stripe count in btrfs_calc_avail_data_space
authorDavid Sterba <dsterba@suse.com>
Tue, 18 Jun 2019 18:00:13 +0000 (20:00 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 2 Jul 2019 10:30:51 +0000 (12:30 +0200)
commite1ea2beee284d8e434e51e60de9e157a18fe8b42
tree0b4ea2e7e67462cf7addb35a87772db1a22575fd
parent4f080f571192b0347f45b5709a291af473824484
btrfs: use raid_attr for minimum stripe count in btrfs_calc_avail_data_space

Minimum stripe count matches the minimum devices required for a given
profile. The open coded assignments match the raid_attr table.

What's changed here is the meaning for RAID5/6. Previously their
min_stripes would be 1, while newly it's devs_min. This however shold be
the same as before because it's not possible to create filesystem on
fewer devices than the raid_attr table allows.

There's no adjustment regarding the parity stripes (like
calc_data_stripes does), because we're interested in overall space that
would fit on the devices.

Missing devices make no difference for the whole calculation, we have
the size stored in the structures.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/super.c