]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: support page uptodate assertions in subpage mode
authorQu Wenruo <wqu@suse.com>
Thu, 25 Mar 2021 07:14:42 +0000 (15:14 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 6 Apr 2021 13:35:58 +0000 (15:35 +0200)
commitc554149a6b5fb526c8e85d44f9c0e0777229608e
treea88b43a2625d524e64bfb6c80ad05150bf3bce21
parente752c1f9d9e8bce91c1e026e151948569f155c7e
btrfs: support page uptodate assertions in subpage mode

There are quite some assert checks on page uptodate in extent buffer
write accessors.  They ensure the destination page is already uptodate.

This is fine for regular sector size case, but not for subpage case, as
for subpage we only mark the page uptodate if the page contains no hole
and all its extent buffers are uptodate.

So instead of checking PageUptodate(), for subpage case we check the
uptodate bitmap of btrfs_subpage structure.

To make the check more elegant, introduce a helper,
assert_eb_page_uptodate() to do the check for both subpage and regular
sector size cases.

The following functions are involved:

- write_extent_buffer_chunk_tree_uuid()
- write_extent_buffer_fsid()
- write_extent_buffer()
- memzero_extent_buffer()
- copy_extent_buffer()
- extent_buffer_test_bit()
- extent_buffer_bitmap_set()
- extent_buffer_bitmap_clear()

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c