Qu Wenruo 3b8358407a btrfs: refactor btrfs_invalidatepage() for subpage support
This patch will refactor btrfs_invalidatepage() for the incoming subpage
support.

The involved modifications are:

- Use while() loop instead of "goto again;"
- Use single variable to determine whether to delete extent states
  Each branch will also have comments why we can or cannot delete the
  extent states
- Do qgroup free and extent states deletion per-loop
  Current code can only work for PAGE_SIZE == sectorsize case.

This refactor also makes it clear what we do for different sectors:

- Sectors without ordered extent
  We're completely safe to remove all extent states for the sector(s)

- Sectors with ordered extent, but no Private2 bit
  This means the endio has already been executed, we can't remove all
  extent states for the sector(s).

- Sectors with ordere extent, still has Private2 bit
  This means we need to decrease the ordered extent accounting.
  And then it comes to two different variants:

  * We have finished and removed the ordered extent
    Then it's the same as "sectors without ordered extent"
  * We didn't finished the ordered extent
    We can remove some extent states, but not all.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-06-21 15:19:08 +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