]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit1e6461d2988758afcc36346570923e21d6248b9a
treee2e1930edbe7a4d8f7aef2dd421cd5bf2145b7ab
parentdfe4be968f017f1a53c791149082ee1d03c06495
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