btrfs: update SCRUB_MAX_PAGES_PER_BLOCK
authorQu Wenruo <wqu@suse.com>
Mon, 6 Dec 2021 05:52:57 +0000 (13:52 +0800)
committerDavid Sterba <dsterba@suse.com>
Fri, 7 Jan 2022 13:18:25 +0000 (14:18 +0100)
commit0bb3acdc48243c0db9fd93fc904ce81bdb4049c9
treee2e1930edbe7a4d8f7aef2dd421cd5bf2145b7ab
parent8697b8f88e2a750685b73c16c2a1bd438795ae90
btrfs: update SCRUB_MAX_PAGES_PER_BLOCK

Use BTRFS_MAX_METADATA_BLOCKSIZE and SZ_4K (minimal sectorsize) to
calculate this value.

And remove one stale comment on the value, in fact with recent subpage
support, BTRFS_MAX_METADATA_BLOCKSIZE * PAGE_SIZE is already beyond
BTRFS_STRIPE_LEN, just we don't use the full page.

Also since we're here, update the BUG_ON() related to
SCRUB_MAX_PAGES_PER_BLOCK to ASSERT().

As those ASSERT() are really only for developers to catch early obvious
bugs, not to let end users suffer.

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/scrub.c