]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitc576ad27fc9e9d4ff4d5e42e144b668e2989e911
tree0b4ea2e7e67462cf7addb35a87772db1a22575fd
parentae9ae149975403060d32747b912ae0bf33f00240
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