btrfs: add stripe_len < PAGE_SIZE support for alloc_rbio_*_pages()
The functions alloc_rbio_parity_pages() and alloc_rbio_data_pages()
didn't support stripe_len < PAGE_SIZE cases, and fallback to
alloc_rbio_pages() instead.
That's mostly to avoid the case where both data and P/Q blocks can exist
in the same page.
However even in that case, it's not a big deal, the existing
infrastructures like index_stripe_sectors() can handle it correctly.
Update those functions to support stripe_len < PAGE_SIZE cases, with two
points to note:
- Extra attention needed for the round direction
For alloc_rbio_data_pages() we need to round up, so the last data page
gets allocated.
For alloc_rbio_parity_pages() we need to round down, so the first
P/Q page get allocated.
- Mixed page allocation
We can call alloc_rbio_parity_pages() first, then
alloc_rbio_data_pages().
In that case, it's alloc_pages_bulk() saving us, which always skips
allocated slot. Thus we're still safe.
Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>