diff options
| author | Qu Wenruo <wqu@suse.com> | 2025-10-21 06:51:48 +0300 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2025-11-25 00:03:38 +0300 |
| commit | 988f693a46d83dc832005a1403ae0471eb1f8964 (patch) | |
| tree | a2e72d5aafa7419debc7b2beacb4de0c01f853b1 /include/linux/memory | |
| parent | ca428e9b49c77b0bfc6ebbc8536ed854463b26e2 (diff) | |
| download | linux-988f693a46d83dc832005a1403ae0471eb1f8964.tar.xz | |
btrfs: subpage: simplify the PAGECACHE_TAG_TOWRITE handling
In function btrfs_subpage_set_writeback() we need to keep the
PAGECACHE_TAG_TOWRITE tag if the folio is still dirty.
This is a needed quirk for support async extents, as a subpage range can
almost suddenly go writeback, without touching other subpage ranges in
the same folio.
However we can simplify the handling by replace the open-coded tag
clearing by passing the @keep_write flag depending on if the folio is
dirty.
Since we're holding the subpage lock already, no one is able to change
the dirty/writeback flag, thus it's safe to check the folio dirty before
calling __folio_start_writeback().
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'include/linux/memory')
0 files changed, 0 insertions, 0 deletions
