Qu Wenruo 98af9ab12b btrfs: pass bytenr directly to __process_pages_contig()
As a preparation for incoming subpage support, we need bytenr passed to
__process_pages_contig() directly, not the current page index.

So change the parameter and all callers to pass bytenr in.

With the modification, here we need to replace the old @index_ret with
@processed_end for __process_pages_contig(), but this brings a small
problem.

Normally we follow the inclusive return value, meaning @processed_end
should be the last byte we processed.

If parameter @start is 0, and we failed to lock any page, then we would
return @processed_end as -1, causing more problems for
__unlock_for_delalloc().

So here for @processed_end, we use two different return value patterns.
If we have locked any page, @processed_end will be the last byte of
locked page.
Or it will be @start otherwise.

This change will impact lock_delalloc_pages(), so it needs to check
@processed_end to only unlock the range if we have locked any.

Tested-by: Ritesh Harjani <riteshh@linux.ibm.com> # [ppc64]
Tested-by: Anand Jain <anand.jain@oracle.com> # [aarch64]
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-06-21 15:19:09 +02:00
..
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-09 02:46:07 +01:00
2019-11-18 23:43:44 +01:00
2021-06-21 15:19:07 +02:00
2020-10-07 12:06:57 +02:00
2020-05-25 11:25:37 +02:00
2021-04-27 10:16:46 -07:00
2021-06-03 11:37:14 -07:00
2020-10-07 12:13:17 +02:00
2021-03-05 12:21:14 -08:00